I have a solution in Vb.NET 2008 windows Form with ToolStripMenuItems,
but I need to implement menu navigation without any mouse intervention.
I only found mouse events In ToolStripMenuItems, MenuStrip, etc.
All MenuStrip and ToolStripMenuItems are created programatically, reading user permissions from Database, then add a handler to manage the events, but the client don't want mouse interaction, he wants only keyboard inputs only !.
Add menu routine:
Private Sub AddModulo(ByVal strNAME As String, ByVal strTITULO As String)
Dim oToolStripMenuItem As New ToolStripMenuItem(strTITULO)
oToolStripMenuItem.Name = strNAME
oToolStripMenuItem.Text = "&" & strTITULO
mnuPrincipal.Items.Add(oToolStripMenuItem)
AddHandler oToolStripMenuItem.MouseMove, AddressOf LoadMenu
End Sub
Add item routine:
Private Sub AddItems(ByVal StrModulo As String, ByVal strItem As String)
Dim mnuItem As New ToolStripMenuItem
mnuItem.Name = StrModulo.ToUpper
mnuItem.Size = New System.Drawing.Size(145, 22)
If Microsoft.VisualBasic.Left(strItem, 1) = "-" Then
mnuItem.Text = " " & Microsoft.VisualBasic.Mid(strItem.ToUpper, 2)
mnuItem.BackColor = Color.Blue
mnuItem.ForeColor = Color.White
Else
mnuItem.Text = strItem
End If
mnuItem.Tag = UCase(Mid(StrModulo, 5, 2))
AddHandler mnuItem.Click, AddressOf LoadMenuItem
Dim newOption = mnuPrincipal.Items(mnuPrincipal.Items.Count - 1)
newOption.DropDownItems.Add(mnuItem)
End Sub
Thx.