Page 1 of 1

Implementing OnKey events

Posted: Thu Oct 03, 2013 6:46 am
by m42i
I'm trying to register some keyboard shortcuts for a NewForm panel but I can't get it working.

Here is what I've tried:

Code: Select all

Sub OnStartup
    Set UI = SDB.UI

    Set MainPanel = UI.NewForm
    MainPanel.BorderStyle = 2
    MainPanel.Common.Align = alClient
    Script.RegisterEvent MainPanel.Common, "OnKeyUp", "MainPanelKeyUp"
End Sub

Sub MainPanelKeyUp(Key, State)
    SDB.MessageBox "Key pressed: " + CStr(Key), mtInformation, Array(mbOk)
End Sub
I also tried using MainPanel instead of MainPanel.Common with no luck.