catagoryName = node.SelectSingleNode( "name")filepath = node.SelectSingleNode( "filepath")description = node.SelectSingleNode( "description") Dim menuItem As ToolStripItem = TheHolymenu2.DropDownItems.Add(catagoryName.InnerText)menuItem.Tag = filepath.InnerText AddHandler menuItem.Click, AddressOf AppMenuItem_ClickmenuItem.Tag = description.InnerText AddHandler menuItem.MouseEnter, AddressOf AppMenuItem_Enter AddHandler menuItem.MouseLeave, AddressOf AppMenuItem_Leave Next |
u see, when i click on the menuitem i want the ad_handler: MouseClick to occur
and when i enter, ad_handler: mouseenter should occur
but instead, it reads the description.innertext for both, i know the problem, but i cant find a way round it!
Heres the ad_handlers:
MouseClick:
Protected Sub AppMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Try Dim filename As String = DirectCast(sender, ToolStripItem).Tag Dim app As New Process()app.StartInfo = New ProcessStartInfo(filename)app.Start() Catch ex As ExceptionMsgBox( "Filepath is Incorrect", MsgBoxStyle.Critical, "Error") End Try End Sub |
MouseEnter:
Protected Sub AppMenuItem_Enter(ByVal sender As Object, ByVal e As EventArgs) Try Dim filename As String = DirectCast(sender, ToolStripItem).TagTextBox6.Text = (filename) Catch ex As ExceptionMsgBox( "Description is Corrupt", MsgBoxStyle.Critical, "Error") End Try End Sub |
MouseLeave:
Protected Sub AppMenuItem_Leave(ByVal sender As Object, ByVal e As EventArgs) TryTextBox6.Text = "" Catch ex As Exception End Try End Sub |
Any help will be GREATLY appreciated

ad_handlers!!
Sajid Ahmed
I would create a class (MenuItemInfo) to contain both values:
Protected Class menuItemInfo
Public FilePath As String
Public Description As String
End Class
Set the two values when you create the menuItem:
Dim miInfo As New menuItemInfo
miInfo.FilePath = filepath.InnerText
miInfo.Description = description.InnerText
menuItem.Tag = miInfo
Finally, read the desired value in the event procedure:
Dim menuItem As ToolStripItem = DirectCast(sender, ToolStripItem)
Dim miInfo As menuItemInfo = DirectCast(menuItem.Tag, menuItemInfo)
Dim filename As String = miInfo.FilePath
Steve Russell
Marked as answer