Sign in to follow this  
Followers 0
autoitxp

prevent buttons from pressing many times and tabs

2 posts in this topic

Hi

how can i prevent buttons holding down i just want to press button once and deactivation from current state

and how to set tabs sequence for buttons

Regards

sim

Share this post


Link to post
Share on other sites



Hi

how can i prevent buttons holding down i just want to press button once and deactivation from current state

and how to set tabs sequence for buttons

Regards

sim

May be this?

#include <GuiConstants.au3>
#include <Misc.au3>

Global Const $WM_NOTIFY = 0x004E
Dim $dll = DllOpen("user32.dll")
Dim $Flag

GUICreate("Test", 200, 100)
$button = GUICtrlCreateButton("Push", 10, 10, 50, 25)
GUISetState()

While 1
    Switch GUIGetMsg()
    Case -3
        ExitLoop
    Case Else
        $CurPos = GUIGetCursorInfo()
        If _IsPressed("01", $dll) And $CurPos[4] = $button Then
            If $Flag Then
            GUICtrlSetState($button, $GUI_DISABLE)
            $Flag = Not $Flag
        EndIf
    Else
        If Not $Flag Then
            GUICtrlSetState($button, $GUI_ENABLE)
            $Flag = Not $Flag
        EndIf
    EndIf
EndSwitch
WEnd

Share this post


Link to post
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
Sign in to follow this  
Followers 0