arcker Posted January 19, 2006 Share Posted January 19, 2006 Hi evry1 i've a little problem i would like to know if it's possible to set the state of multiple controls , in one line of code ? i would like to do : $group=GuiCtrlCreateGroup("Group1", 210, 80, 270, 330,) ;$group=GUIStartGroup() $nom = GuiCtrlCreateInput("Nom de l'utilisateur", 230, 110, 220, 30) $prenom = GuiCtrlCreateInput("Prénom", 230, 160, 220, 30) $type = GuiCtrlCreateInput("Type", 230, 210, 220, 30) $membrede = GuiCtrlCreateInput("Membre de", 230, 260, 220, 30) $Input_6 = GuiCtrlCreateInput("Input6", 230, 310, 220, 30) $Input_7 = GuiCtrlCreateInput("Input7", 230, 360, 220, 30) ;GUICtrlCreateGroup ("",-99,-99,1,1) ;GUICtrlSetState($group,$gui_hide) because it's a little of boring to set the state for each control just to know thx for any help and work-around -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
CyberSlug Posted January 19, 2006 Share Posted January 19, 2006 It depends.... If you want to apply the $GUI_HIDE state to everything then: #include <GuiConstants.au3> GuiCreate("foo") $group=GuiCtrlCreateGroup("Group1", 210, 80, 270, 330) $nom = GuiCtrlCreateInput("Nom de l'utilisateur", 230, 110, 220, 30) $prenom = GuiCtrlCreateInput("Prénom", 230, 160, 220, 30) $type = GuiCtrlCreateInput("Type", 230, 210, 220, 30) $membrede = GuiCtrlCreateInput("Membre de", 230, 260, 220, 30) $Input_6 = GuiCtrlCreateInput("Input6", 230, 310, 220, 30) $Input_7 = GuiCtrlCreateInput("Input7", 230, 360, 220, 30) ; Hide all controls created so far For $i = $group to $Input_7 GuiCtrlSetState($i, $GUI_HIDE) Next GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd It would be much better to use arrays, especially if you have different types of controls...#include <GuiConstants.au3> GuiCreate("foo") ;Let's create a dozen labels and input boxes Dim $labelControl[12], $inputControl[12] For $i = 0 to 11 GuiCtrlCreateLabel("Label " & $i, 20, 10+$i*30, 50, 20) GuiCtrlSetStyle(-1, $SS_RIGHT);note -1 refers to most recently created control GuiCtrlCreateInput("", 90, 10+$i*30, 100, 20) Next GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE WEnd Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now