im trying to create a menu with C# by using #develop but it doesnt let me.
the IDE lets me add items to a menu item but it doesnt let me specify the parent menu item. that sounds confusing so here's a screenshot.
http://img44.imageshack.us/img44/637/sdevelop7er.jpg
so does anyone know how i can make the ContextMenu thing have any text? i've tried editing the #develop generated text but i dont see anything for the context menu
edit: bah i solved it. seems i was using the wrong object -_-
You needed to use a MainMenu instead of a ContextMenu.
yeah i figured that out
but now i get a diffrent problem. im trying to make an event for one of the menu items but im having difficulty with it. the #develop IDE does it by doing this.Load = System.EventHandler(this.MainFormLoad);
but im having difficulty figuring out what to put in the EventHandler cause i dont see any option in the "this" object to handle Menu Events
MenuItem events aren't handled via the Load event. They're handled via the MenuItem.Click event:
this.menuItem1.Click += new EventHandler(menuItem1_Click);
that was a example for a Form's Load Event
i tried
this.mnuExit.Click += new System.EventHandler(mnuExit_Click);
and got the error
QuoteThe name 'mnuExit_Click' does not exist in the class or namespace 'Mangix.MainForm'(CS0103)'
Did you create a function:
public void mnuExit_Click(object sender, EventArgs e) {}
?
just did and it fixed the error. thank you :)