all groups > dotnet windows forms > august 2005 >
You're in the

dotnet windows forms

group:

Menu suggestion



Menu suggestion Bud J via DotNetMonster.com
8/12/2005 12:00:00 AM
dotnet windows forms: normally with a menu i use a simple switch statement. i'm thinking this is
not a very good way of doing it. does anyone have any suggestions on a
better way


--
Re: Menu suggestion Lloyd Dupont
8/12/2005 12:00:00 AM
what about an event handler?

--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey.
[quoted text, click to view]

Re: Menu suggestion Lloyd Dupont
8/13/2005 12:00:00 AM
I didn't really understand what you mean, so..
but that's the way I handle event!

--
If you're in a war, instead of throwing a hand grenade at the enemy, throw
one of those small pumpkins. Maybe it'll make everyone think how stupid war
is, and while they are thinking, you can throw a real grenade at them.
Jack Handey.
[quoted text, click to view]

Re: Menu suggestion Lloyd Dupont
8/13/2005 12:00:00 AM
[quoted text, click to view]
uh?
what kind of variation?
no "if" will ever be involved in such event dispatching....

Re: Menu suggestion Bud J via DotNetMonster.com
8/13/2005 6:15:11 AM
thanks for the reply.

If i understand what you are saying
mnuItemOne.Click+= new EventHandler(OnMenuOneClick)


--
Re: Menu suggestion Bud J via DotNetMonster.com
8/13/2005 6:21:31 AM
oops accidentally posted partial message

to continue

if i understand what you are saying
menuOne.Click+=new EventHandler(MenuOneClick)
menuTwo.Click+=new EventHandler(MenuTwoClick)

would definetly work but wouldn't that be a variation of a switch.


--
Re: Menu suggestion Herfried K. Wagner [MVP]
8/13/2005 9:47:47 PM
"Bud J via DotNetMonster.com" <forum@DotNetMonster.com> schrieb:
[quoted text, click to view]

Nope. The code you posted is the way to go... :-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
AddThis Social Bookmark Button