Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I am building a context menu in run time. I need to figure out what specific menu item has been clicked. There is no menuItem.Clicked = True

 

I would love to just go:

 

If menuItem1.clicked = true then

 

:

:

:

:

 

end if

 

But since there is no Menu Item property like that I am stuck. I used addHandler when I create the Menu Items. It looks as such:

 

AddHandler menuItem.Click, AddressOf ItemsClick

 

 

Thus I am using the item click method which only has two arguments: (sender As Object, e As System.EeventArgs)

 

I would love to be able write:

 

Private Sub ItemsClick(ByVal sender As Object, ByVal e As System.EventAgrs)

 

 

debug.writeline("THE CURRENT MENU ITEM CLICKED IS: " & ________

 

 

 

End Sub

 

 

 

 

I need some help on the '_______________' part. How do I get the current menu item that is selected when menu item can be anything from menuItem_1.......menuItem_N?

 

Thanks, Matt

 

Thanks, Matt

  • *Experts*
Posted

What a coincidence! Someone on our sister forum, with the

same name as you, posted the exact same thing! And the

solution was the same, too! ;)

 

Anyway, check it out:

http://www.visualbasicforum.com/showthread.php?threadid=148485

 

Please limit your posts to either one of the forums. If you're

going to use VB.NET from now on, you might as well stay here.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...