Jump to content
Sign in to follow this  
autoitxp

prevent buttons from pressing many times and tabs

Recommended Posts

autoitxp

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
rasim

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.