Jump to content

prevent buttons from pressing many times and tabs


autoitxp
 Share

Recommended Posts

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
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...