Jon,

        Dim str As String = "" & ctype(sender, ToolStripMenuItem).Tag
        MsgBox("Tag value: " & str)

Seeya
Matthew Wills | Senior Analyst Programmer | Adviser Tools and Services |
Financial Planning and Third Party | NAB Technology

Phone: 02 9957 8183 | Mobile: 0435 002 520 | Email:
[EMAIL PROTECTED]



                                                                          
             Jon Rothlander                                               
             <[EMAIL PROTECTED]                                            
             .NET>                                                      To
             Sent by:                  ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
             "Discussion of                                             cc
             advanced .NET                                                
             topics."                                              Subject
             <ADVANCED-DOTNET@         Re: [ADVANCED-DOTNET] Runtime      
             DISCUSS.DEVELOP.C         Created MenuStripItems - Click     
             OM>                       Event Handler                      
                                                                          
                                                                          
             13/07/2007 08:13                                             
             AM                                                           
                                                                          
                                                                          
             Please respond to                                            
              "Discussion of                                              
               advanced .NET                                              
                 topics."                                                 
             <ADVANCED-DOTNET@                                            
             DISCUSS.DEVELOP.C                                            
                    OM>                                                   
                                                                          
                                                                          




I was able to add an event handler and pass each click event to the same
subroutinue.  However, now I do not have access to the event args that I
need.  I am trying to get the tag value of the item clicked on.

Any ideas how to get that from e?

Private Sub MenuStrip_ItemClicked(ByVal sender As System.Object, ByVal e As
System.EventArgs)
        Dim str As String = "" & e.ToString
        MsgBox("Tag value: " & str)
    End Sub


You could also ask this same question as follows...

I have a menustrip with a hardcode menu items.  Each has a tag value.  When
the user clicks on the item, I want to pull the tag value.  However, based
on the parameters for the event, I cannot see how to get the tag.

Any ideas?

Private Sub Test1ToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Test1ToolStripMenuItem.Click
        Dim str As String = Test1ToolStripMenuItem.Tag
    End Sub

This would work, but I need to use the parameters to pull the value as I
will not know that Text1ToolStripMenuItem was the one selected.  How do I
find out which one was selected a get it's TAG value?

Best regards,
Greg

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop..com




National Australia Bank Ltd - ABN 12 004 044 937
This email may contain confidential information. If you are not the intended 
recipient, please immediately notify us at [EMAIL PROTECTED] or by replying to 
the sender, and then destroy all copies of this email. Except where this email 
indicates otherwise, views expressed in this email are those of the sender and 
not of National Australia Bank Ltd. Advice in this email does not take account 
of your objectives, financial situation, or needs. It is important for you to 
consider these matters and, if the e-mail refers to a product(s), you should 
read the relevant Product Disclosure Statement(s)/other disclosure document(s) 
before making any decisions. If you do not want email marketing from us in 
future, forward this email with "unsubscribe" in the subject line to [EMAIL 
PROTECTED] in order to stop marketing emails from this sender. National 
Australia Bank Ltd does not represent that this email is free of errors, 
viruses or interference.

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to