Sign in to follow this  
Followers 0
CEBSS

Enable\disable button\resolved

3 posts in this topic

#1 ·  Posted (edited)

Hi

I do not know how to enable a "grayed" button once a criteria has been met.

My input box must = 6 numbers. (no less or no more).

Once the 6 digits are inserted the ok button must be enabled.

Please asist

Thanks

Alistair

Edited by CEBSS

Share this post


Link to post
Share on other sites



Hi

I do not know how to enable a "grayed" button once a criteria has been met.

My input box must = 6 numbers. (no less or no more).

Once the 6 digits are inserted the ok button must be enabled.

Please asist

Thanks

Alistair

See if this is what you are after.

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

CompName()

Func CompName()
    Local $Flag = 0
    GUICtrlCreateGroup("", -679, -497, 200, 200) ;close group
    GUICreate("POS SETUP", 1279, 745)
    $Alistair = GUICtrlCreateInput("", 226, 100, 42)    
    GUICtrlSetLimit($Alistair, 6, 6)
    GUICtrlCreateLabel("SC", 200, 100)  
    GUICtrlCreateLabel("E001", 273, 100)
    $MFS1OK = GUICtrlCreateButton("OK", 150, 220, 226, 55)
    ControlDisable("POS SETUP", "", $MFS1OK)
    GUICtrlCreateLabel("PLEASE ENTER MFS 1 COMPUTER NAME AND CLICK OK", 100, 55)    
    GUISetState()
    
    While 1
        $msg = GUIGetMsg()
        $Cousin = GUICtrlRead($Alistair)
        Select
            Case $msg = $GUI_EVENT_CLOSE
                ExitLoop
            Case StringLen($Cousin) = 6 And $Cousin < "999999" And $Cousin > "000001" And $Flag = 0
                $Flag = 1
                ControlEnable("POS SETUP", "", $MFS1OK)             
            Case $msg = $MFS1OK
                MsgBox(0, "", "go")
                GUISetState(@SW_HIDE)
                ExitLoop
        EndSelect
    WEnd
    ;Call("POSNO")
    
    Exit

EndFunc   ;==>CompName

Share this post


Link to post
Share on other sites

Thank you sir..

Regards

Alistair

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