stev-io
Member
I'm new to VB.NET and am creating a little program that will run in the sys tray with a context menu. the menu has sub menus and i want to call the same sub when each of them is clicked. Here's the menu setup:
This all works well, but when i call the sub i want to extract some of the sender information that you can see when you debug the program. Is there an easy way to get this info?
VB.NET:
'this will add the root items to the menu
mobContextMenu.MenuItems.Add(New MenuItem("Select AWS"))
mobContextMenu.MenuItems.Add("-")
mobContextMenu.MenuItems.Add(New MenuItem("About", New EventHandler(AddressOf AboutBox)))
mobContextMenu.MenuItems.Add("-")
mobContextMenu.MenuItems.Add(New MenuItem("Exit", New EventHandler(AddressOf ExitProgram)))
'this will add the states to the select aws menu item
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("VIC"))
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("SA"))
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("WA"))
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("NT"))
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("QLD"))
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("NSW"))
mobContextMenu.MenuItems.Item(0).MenuItems.Add(New MenuItem("TAS"))
'this will add the aws items to the states menu item
mobContextMenu.MenuItems.Item(0).MenuItems.Item(0).MenuItems.Add(New MenuItem("Ballarat", New EventHandler(AddressOf ChangeVars)))
mobContextMenu.MenuItems.Item(0).MenuItems.Item(0).MenuItems.Add(New MenuItem("Melbourne", New EventHandler(AddressOf ChangeVars)))
Last edited by a moderator: