OnEvent("Focus") _probably_ not working in Keysharp
Issue #30
closed
Working AHK code:
MyGui := Gui(, "Groupbox")
MyGui.Opt("+AlwaysOnTop")
MyEdit := MyGui.Add("Edit", "w200 h200")
MyEdit.OnEvent("Focus", StartEditToolTip)
MyMoney := MyGui.Add("Text", , "I'm only in it for the money...")
MyGui.Show()
StartEditToolTip(*) {
ToolTipText := "
(
I should be a ToolTip.
Am I a ToolTip?
Or am I a tool?
)"
ToolTip(ToolTipText)
Sleep(2000)
ToolTip()
ControlFocus(MyMoney, "GroupBox")
}
Non-working Keysharp code:
MyGui := Gui(, "Groupbox")
MyGui.Opt("+AlwaysOnTop")
MyEdit := MyGui.Add("Edit", "w200 h200")
MyEdit.OnEvent("Focus", "StartEditToolTip")
MyMoney := MyGui.Add("Text", , "I'm only in it for the money...")
MyGui.Show()
StartEditToolTip() {
ToolTipText := "
(
I should be a ToolTip.
Am I a ToolTip?
Or am I a tool?
)"
ToolTip(ToolTipText)
Sleep(2000)
ToolTip()
ControlFocus(MyMoney, "GroupBox")
}
Comments (4)
-
reporter -
reporter Retest following commit of Aug 19 2022, with fix for typo in my code that you caught.
MyGui := Gui(, "GroupBox") MyGui.Opt("+AlwaysOnTop") MyEdit := MyGui.Add("Edit", "w200 h200") MyEdit.OnEvent("Focus", "StartEditToolTip") MyMoney := MyGui.Add("Text", , "I'm only in it for the money...") MyGui.Show() StartEditToolTip() { ToolTipText := " ( I should be a ToolTip. Am I a ToolTip? Or am I a tool? )" ToolTip(ToolTipText) Sleep(2000) ToolTip() ControlFocus(MyMoney, "GroupBox") }
Working, please mark as resolved and close. Thanks!
-
repo owner - changed status to resolved
-
repo owner - changed status to closed
- Log in to comment
No error from Keysharp, but tooltip never displays.