• Welcome to Valhalla Legends Archive.
 

[C#]Menu

Started by Mangix, September 14, 2005, 05:48 PM

Previous topic - Next topic

Mangix

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 -_-

MyndFyre

You needed to use a MainMenu instead of a ContextMenu.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

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

MyndFyre

MenuItem events aren't handled via the Load event.  They're handled via the MenuItem.Click event:


this.menuItem1.Click += new EventHandler(menuItem1_Click);
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

#4
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)'

MyndFyre

Did you create a function:

public void mnuExit_Click(object sender, EventArgs e) {}

?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

just did and it fixed the error. thank you :)