Private Sub AssignMenuHandler For Each historyItem In _historyMenu.HistoryItems menItem = historyItem.MenuItem AddHandler menItem.Click, AddressOf MenuHandler Next End Sub Public Sub MenuHandler(ByVal sender As Object, ByVal e As EventArgs) Dim menuItem As ToolStripMenuItem = CType(sender, ToolStripMenuItem) Dim historyItem As String historyItem = menuItem.Text .....
Private Sub LoadHistory(ByVal mainMenuItem As ToolStripMenuItem, delegateProcedure as ???) Dim menTemp As System.Windows.Forms.ToolStripMenuItem Dim menuText As String Dim historyItem As HistoryItem For Each historyItem In _historyItems menTemp = historyItem.MenuItem AddHandler menTemp.Click, AddressOf delegateProcedure Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)