Menu

Résolu
cs_thebigboss Messages postés 216 Date d'inscription jeudi 30 janvier 2003 Statut Membre Dernière intervention 12 avril 2017 - 20 nov. 2004 à 01:06
cs_thebigboss Messages postés 216 Date d'inscription jeudi 30 janvier 2003 Statut Membre Dernière intervention 12 avril 2017 - 24 nov. 2004 à 11:18
Salut,

J'ai un problème tout con, je créé un Menu, mais lorsque je lance mon appli, il ne s'affiche pas????

J'utilise SharpDevelop.

Merci d'avance.

6 réponses

APWEB Messages postés 74 Date d'inscription lundi 30 juin 2003 Statut Membre Dernière intervention 18 octobre 2006 2
20 nov. 2004 à 18:22
Sinon essaye de rajouter dans //MainForm
"this.Menu = this.mainMenu"
Je ne vois de ref. a ton menu dans cette partie .

AP
3
Electrochip Messages postés 5 Date d'inscription samedi 20 novembre 2004 Statut Membre Dernière intervention 20 novembre 2004
20 nov. 2004 à 01:26
Qu'entend tu par "Menu" ?
Un bout de code serai beaucoup plus parlant ;)
0
cs_thebigboss Messages postés 216 Date d'inscription jeudi 30 janvier 2003 Statut Membre Dernière intervention 12 avril 2017 2
20 nov. 2004 à 10:38
En fait, j'utilise un composant mainMenu grâce auquel je crée mon menu directement, mais celui ci n'apparait pas lors de l'execution du prog.

J'ai essayé de ne laisser de mon code que ce qui concerne la définition du menu pour simplifier les choses.

public class MainForm : System.Windows.Forms.Form
{
private System.Windows.Forms.MenuItem menuQuitter;
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem menuItem;
private System.Windows.Forms.MenuItem menuAPropos;
private System.Windows.Forms.MenuItem menuItem3;
private System.ComponentModel.Container components = null;

public MainForm()
{
InitializeComponent();
}

protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

void InitializeComponent() {
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuAPropos = new System.Windows.Forms.MenuItem();
this.menuItem = new System.Windows.Forms.MenuItem();
this.mainMenu = new System.Windows.Forms.MainMenu();
this.menuQuitter = new System.Windows.Forms.MenuItem();
((System.ComponentModel.ISupportInitialize)(this.timer)).BeginInit();
this.SuspendLayout();
//
// menuItem3
//
this.menuItem3.Index = 0;
this.menuItem3.Text = "A";
//
// menuAPropos
//
this.menuAPropos.Index = 1;
this.menuAPropos.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem3});
this.menuAPropos.Text = "?";
this.menuAPropos.Click += new System.EventHandler(this.Menu_APropos);
//
// menuItem
//
this.menuItem.DefaultItem = true;
this.menuItem.Index = 0;
this.menuItem.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuQuitter});
this.menuItem.Text = "Fichier";
//
// mainMenu
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem,
this.menuAPropos});
//
//
// menuQuitter
//
this.menuQuitter.Index = 0;
this.menuQuitter.Text = "Quitter";
this.menuQuitter.Click += new System.EventHandler(this.Menu_Quitter);
//
// MainForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(856, 701);
this.Name = "MainForm";
this.Text = "Dames Chinoises";
this.Load += new System.EventHandler(this.MainFormLoad);
this.Activated += new System.EventHandler(this.MainForm_Focused);
((System.ComponentModel.ISupportInitialize)(this.timer)).EndInit();
this.ResumeLayout(false);
}
0
Electrochip Messages postés 5 Date d'inscription samedi 20 novembre 2004 Statut Membre Dernière intervention 20 novembre 2004
20 nov. 2004 à 16:23
Euh... Oui, je n'avais pas besoin de tout ca.

Essaye juste

Application.Run(new MainForm(args));

dans ton Main
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
TheSaib Messages postés 2367 Date d'inscription mardi 17 avril 2001 Statut Membre Dernière intervention 26 décembre 2007 23
21 nov. 2004 à 19:29
APWEB a raison , si tu n'associe pas ton menu a ta form il ne risque pas de se rajouter

::|The S@ib|::
MVP C#.NET
0
cs_thebigboss Messages postés 216 Date d'inscription jeudi 30 janvier 2003 Statut Membre Dernière intervention 12 avril 2017 2
24 nov. 2004 à 11:18
Merci, tout fonctionne impeccablement.

Le prog que j'ai fait est un jeu de dames chinois, j'ai encore quelques modifs à apporter et puis je le téléchargerai sur le site.
0
Rejoignez-nous