<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Il giorno ven 21 set 2018 alle ore 04:20 Me <<a href="mailto:adamnt42@gmail.com">adamnt42@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am trying to add a new menu at runtime. That works fine and it gets added into the Action.List. However, the menu has a shortcut and that doesn't get added into the shortcuts managed by Action.Configure.<br>
The code is pretty straightforward:<br>
Dim TestMenu as Menu<br>
<br>
TestMenu = New Menu(mnuFile)<br>
With TestMenu<br>
.Name="mnuTest"<br>
.Caption="Test Action"<br>
.ShortCut="CTRL+T"<br>
Action="MENU.Test"<br>
End With<br>
<br>
Any clues?<br>
b<br>
-- <br>
Me <<a href="mailto:adamnt42@gmail.com" target="_blank">adamnt42@gmail.com</a>><br>
<br></blockquote><div><br></div><div>Maybe by writing it this way:<br><br>Public Sub Form_Open()<br> <br> Dim TestMenu As Menu<br> <br> TestMenu = New Menu(mnuFile)<br> With TestMenu<br> .Name = "mnuTest"<br> .Caption = "Test Action"<br> '.ShortCut = "CTRL+T"<br> .Action = "menu-test"<br> End With<br> Action["menu-test"].Shortcut = "CTRL+T"<br> <br>End<br><br>Public Sub Action_Activate(sKey As String) As Boolean<br> <br> Select Case sKey<br> Case "menu-test"<br> Print "menu test"<br> End Select<br> <br>End<br></div><div><br></div><div>Regards</div><div>Gianluigi<br></div></div></div></div>