Private Sub AddEventClick(ByVal target As ToolStripItemCollection) For i As Integer = 0 To target.Count Dim ts As ToolStripMenuItem = target(i) If ts.HasDropDownItems Then AddEventClick(ts.DropDownItems) 'Here I want to assign the event handler 'tsh.AddClickEvent(ts) Next End Sub Private Sub toolStripDrawing() tsh = New TSHandler Dim target As ToolStripItemCollection = BuatObjekToolStripMenuItem.DropDownItems AddEventClick(target) End Sub
AddHandler
AddHandler ts.Click, AddressOf ToolStripMenuItem_Click 'place the name of your function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)