Sign in to follow this  
Followers 0
babou

checkbox and input

4 posts in this topic

Hi all,

Sorry for my stupid question but i do not know how to script, a GUICtrlCreateInput() which appears and disapear with a checkbox action ?

that what i have tested :

GUICreate("Deploiement d'appli")
Opt("GUICoordMode",2)
GUICtrlCreateLabel ("Veuillez rentrer le reseau à scanner", 10, 10)
GUICtrlCreateLabel ("192.168.",  -100, 10,50)
$Network = GUICtrlCreateInput ("200", 0,  -21, 50)
GUICtrlCreateLabel ("de ",  5, -21,50)
$Network1 = GUICtrlCreateInput ("3",  -20,  -21, 50)
GUICtrlCreateLabel ("à ",  5, -21,50)
$Network2 = GUICtrlCreateInput ("200",  -20,  -21, 50)
$Flag = GUICtrlCreateCheckbox ("Verifier Flag", -200, 10, 100)
$run = GUICtrlCreateButton ("Deployer", -100, 300, 100)



GUISetState () 

While 1
    $msg = GUIGetMsg()
    $FlagCheck = GUICtrlRead($Flag)
    while $FlagCheck =1
        $FlagCheck = GUICtrlRead($Flag)
        GUICtrlCreateLabel (" Flag",  5, -21,50)
        $FlagInput = GUICtrlCreateInput ("3",  -20,  -21, 50)
    WEnd
            
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Run
            $NetworkRead = GUICtrlRead($Network)
            $NetworkRead1 = GUICtrlRead($Network1)
            $NetworkRead2 = GUICtrlRead($Network2)
            
            msgbox(0,"texte tapé","Vous allez deployer de 192.168."&$FlagCheck)
;~          deploy($NetworkRead,$NetworkRead1,$NetworkRead2)
    EndSelect
Wend


Func deploy($RESEAU,$IPSTART,$IPEND)
For $i = $IPSTART to $IPEND Step 1
    $IP=$RESEAU&"."&$i
Next
MsgBox(0,"nom du reseau", "noim du reseau est  "&$IP)
EndFunc

But of course it do not work :P

Share this post


Link to post
Share on other sites



I can't understand what you are trying to accomplish... Are you trying to make a script, which checks, if a checkbox is checked, and when it is, hide an inputbox, and vice-versa?

Share this post


Link to post
Share on other sites

exactly what i want to do :P

Share this post


Link to post
Share on other sites

Try this:

#include <GUIConstants.au3>
GUICreate("Deploiement d'appli")
Opt("GUICoordMode",2)
GUICtrlCreateLabel ("Veuillez rentrer le reseau à scanner", 10, 10)
GUICtrlCreateLabel ("192.168.",  -100, 10,50)
$Network = GUICtrlCreateInput ("200", 0,  -21, 50)
GUICtrlCreateLabel ("de ",  5, -21,50)
$Network1 = GUICtrlCreateInput ("3",  -20,  -21, 50)
GUICtrlCreateLabel ("à ",  5, -21,50)
$Network2 = GUICtrlCreateInput ("200",  -20,  -21, 50)
$Flag = GUICtrlCreateCheckbox ("Verifier Flag", -200, 10, 100)
$run = GUICtrlCreateButton ("Deployer", -100, 300, 100)



GUISetState ()

While 1
    $msg = GUIGetMsg()    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Flag
            If GUICtrlRead($Flag) <> $GUI_CHECKED Then
                GUICtrlSetState($Network, $GUI_SHOW)
            Else
                GUICtrlSetState($Network, $GUI_HIDE)
            EndIf
        Case $msg = $Run
            $NetworkRead = GUICtrlRead($Network)
            $NetworkRead1 = GUICtrlRead($Network1)
            $NetworkRead2 = GUICtrlRead($Network2)
            
            msgbox(0,"texte tapé","Vous allez deployer de 192.168."&GUICtrlRead($Network))
;~             deploy($NetworkRead,$NetworkRead1,$NetworkRead2)
    EndSelect
Wend


Func deploy($RESEAU,$IPSTART,$IPEND)
For $i = $IPSTART to $IPEND Step 1
    $IP=$RESEAU&"."&$i
Next
MsgBox(0,"nom du reseau", "noim du reseau est  "&$IP)
EndFunc

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