Bonjour,
Je cherche à faire une fenêtre toute simple avec un menu en c#.
voici le code de ma frame :
Code :
- /*
- * Created by SharpDevelop.
- * User: billot-lau
- * Date: 23/07/2004
- * Time: 08:54
- *
- * To change this template use Tools | Options | Coding | Edit Standard Headers.
- */
- using System;
- using System.Windows.Forms;
- namespace DefaultNamespace
- {
- /// <summary>
- /// Description of MainForm.
- /// </summary>
- public class MainForm : System.Windows.Forms.Form
- {
- private System.Windows.Forms.MainMenu mainMenu;
- private System.Windows.Forms.MenuItem menuItem;
- public MainForm()
- {
- //
- // The InitializeComponent() call is required for Windows Forms designer support.
- //
- InitializeComponent();
- MainMenu mnuFileMenu = new MainMenu();
- this.Menu = mnuFileMenu;
- //
- // TODO: Add constructor code after the InitializeComponent() call.
- //
- }
- [STAThread]
- public static void Main(string[] args)
- {
- Application.Run(new MainForm());
- }
- #region Windows Forms Designer generated code
- /// <summary>
- /// This method is required for Windows Forms designer support.
- /// Do not change the method contents inside the source code editor. The Forms designer might
- /// not be able to load this method if it was changed manually.
- /// </summary>
- private void InitializeComponent() {
- this.menuItem = new System.Windows.Forms.MenuItem();
- this.mainMenu = new System.Windows.Forms.MainMenu();
- //
- // menuItem
- //
- this.menuItem.Index = 0;
- this.menuItem.Text = "Hello";
- //
- // mainMenu
- //
- this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
- this.menuItem});
- this.mainMenu.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
- //
- // MainForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(292, 266);
- this.Menu = this.mainMenu;
- this.Name = "MainForm";
- this.Text = "MainForm";
- }
- #endregion
- }
- }
|
Lorsque je lance le tout je n'ai pas d'erreur mais pas de barre non plus .
Pourquoi SVP ?
Message édité par axl the mux le 23-07-2004 à 12:36:32
---------------
nos utopies d'aujourd'hui sont les réalités de demain.