|
-
Oct 24th, 2003, 01:56 PM
#1
Thread Starter
New Member
Responding to Menu click event
I have a 'History' menu on the main menu in myformapp. When the form loads, the menu is populated with menuitems that come from text stored in an array of strings, sCommandArray().
The menu is populated using a for loop:
For iCounter = 0 To sCommandArray.GetUpperBound(0)
.m_mnuCommandHistory.MenuItems.Add(sCommandArray(iCounter), New EventHandler(AddressOf CommandHistoryClick))
next
The text of each menuitem is the contents of an array element.
The event handler, CommandHistoryClick, is declared as follows:
Private Sub CommandHistoryClick(ByVal Sender As system.object, ByVal e As System.EventArgs) Handles m_mnuCommandHistory.Click
End Sub
How do I determine which menuitem is the sender? I want to populate a text box with whichever menuitem is selected.
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
|
Click Here to Expand Forum to Full Width
|