Jump to content

Last Button Pressed


 Share

Recommended Posts

Theres probably another way, but I would have whatever function is called do as the last thing a mouseclick somewhere else (the desktop, or an unused part of the GUI..) to remove the focus from the button that was clicked to call it..

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Link to comment
Share on other sites

What dots?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 250, 57, 192, 124)
$Button1 = GUICtrlCreateButton("1", 8, 8, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("2", 88, 8, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("3", 168, 8, 75, 25, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Last button pressed: ", 72, 40, 1000, 20)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            GUICtrlSetData($Label1,"Last button pressed: 1")
        Case $Button2
            GUICtrlSetData($Label1,"Last button pressed: 2")
        Case $Button3
            GUICtrlSetData($Label1,"Last button pressed: 3")
    EndSwitch
WEnd
Edited by Info
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...