I have this code to add ToolStripMenuItems when my form loads.
It adds all items from my ListBox to my ToolStripMenuItem and it works fine. But now i need the same item to be selected in my ListBox when I click any item in ToolStripMenuItem (all items in ListBox and ToolStripMenuItem are the same). The problem is that ListBox items are user changeable. I wanted to find ToolStripMenuItem index and make ListBox selected index the same, but i can't seem to find ToolStripMenuItem index property. Can anyone please help me? And one more thing. How do I make something happen when i click ToolStripMenuItem? Once again, ToolStripMenuItems are dynamic, which means users can change them. It would be easy to do that if items were static... Please answer me. Thank you.Code:Dim i As Integer = 0 Dim stanicastring As String While i < ListBox1.Items.Count stanicastring = ListBox1.Items.Item(i) listastanica.DropDownItems.Add(stanicastring) i = i + 1 End While




Reply With Quote