Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamically population menu
Message
From
01/04/2008 00:15:08
 
 
To
31/03/2008 13:13:21
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01307050
Message ID:
01307225
Views:
9
Andrus,

I'm not sure why the keyboard doesn't work and the mouse does, but I am offering another solution ... instead of waiting for a menu item to be used before you populate it, why don't you just pre-populate them all at once, when the Form or the Menu is instantiated?

~~Bonnie



>Populating one my WinForms submenu requires database access over internet.
>So it is better to populate it at runtime when in may become visible.
>
>For this I use designer generated code in form constructor:
>
>this.openToolStripMenuItem.DropDownOpening += new
>System.EventHandler(this.openToolStripMenuItem_DropDownOpening);
>
>Initially menu does not contain any items.
>When I move mouse to aparent menu item all is OK: DropDownOpening event
>handler fills this menu with items.
>
>However when I use keyboard keys to move to parent item, this event does not
>fire: selection triange does not appear and it is not possible to open
>submenu. I tried to use
>this.openToolStripMenuItem.CanSelect = true;
>but got compile error CanSelect being is read only.
>
>How to populate submenu when parent menu item is activated using keyboard ?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform