Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / August 2005

Tip: Looking for answers? Try searching our database.

Menu suggestion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bud J - 13 Aug 2005 03:47 GMT
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
Lloyd Dupont - 13 Aug 2005 04:57 GMT
what about an event handler?

Signature

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.

> 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
Bud J - 13 Aug 2005 07:15 GMT
thanks for the reply.

  If i understand what you are saying
       mnuItemOne.Click+= new EventHandler(OnMenuOneClick)
Bud J - 13 Aug 2005 07:21 GMT
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.
Lloyd Dupont - 13 Aug 2005 09:30 GMT
> to continue
>
[quoted text clipped - 3 lines]
>
> would definetly work but wouldn't that be a variation of a switch.
uh?
what kind of variation?
no "if" will ever be involved in such event dispatching....
Herfried K. Wagner [MVP] - 13 Aug 2005 20:47 GMT
"Bud J via DotNetMonster.com" <forum@DotNetMonster.com> schrieb:
> 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.

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

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

Lloyd Dupont - 13 Aug 2005 09:29 GMT
I didn't really understand what you mean, so..
but that's the way I handle event!

Signature

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.

> thanks for the reply.
>
>   If i understand what you are saying
>        mnuItemOne.Click+= new EventHandler(OnMenuOneClick)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.