-
Dynamic Context Menus
I want to create a context menu dynamically during run time.
easy enough with something like:
For I = 1 To UBound(g_DispMenu)
myForm.mnurightSlot.MenuItems.Add(g_DispMenu(I).Description)
Next
So the question becomes how do I handle some one clicking an item? I can not do something like this as I do not know how many menu items until run time?
Private Sub mnuRightSlot_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles MenuItem1.Click, MenuItem2.Click, MenuItem3.Click
-
Look up the AddHandler statement in VB's online help.
Phil Weber
http://www.philweber.com
Please post questions to the forums, where others may benefit.
I do not offer free assistance by e-mail. Thank you!
-
Dynamic Context Menus
For ASP.NET forms you can put the following in the page_Load method:
if you have a control that you need the contex menu opened on, you can just put the following into the Page_Load method
if control's id = "lblMyLabel"
you would code the following:
lblMyLabel.Attributes.Add("oncontext", "myJavascriptroutine");
Romel Evans
Similar Threads
-
Replies: 1
Last Post: 09-19-2005, 11:56 AM
-
Replies: 0
Last Post: 06-23-2005, 11:19 AM
-
By Brad Taylor in forum VB Classic
Replies: 16
Last Post: 03-29-2001, 09:21 AM
-
By Brad Taylor in forum VB Classic
Replies: 0
Last Post: 03-26-2001, 04:37 PM
-
Replies: 0
Last Post: 10-11-2000, 06:23 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks