Fossil Rock Posted September 18, 2007 Share Posted September 18, 2007 Can a group be hidden all at once or do I have to stick with hiding each control individually? Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
therks Posted September 18, 2007 Share Posted September 18, 2007 (edited) Individually. Want to see a trick I use though? There are lots of ways to hide groups of controls, but this one is one of my favorites lately. Note: This will only work for controls that are all created one after the other. #include <GUIConstants.au3> $gui = GUICreate('', 200, 200) $dm_Start = GUICtrlCreateDummy() GUICtrlCreateButton('', 0, 0, 100, 20) GUICtrlCreateButton('', 0, 20, 100, 20) GUICtrlCreateButton('', 0, 40, 100, 20) GUICtrlCreateButton('', 0, 60, 100, 20) GUICtrlCreateButton('', 0, 80, 100, 20) GUICtrlCreateInput('', 0, 100, 100, 20) GUICtrlCreateInput('', 0, 120, 100, 20) GUICtrlCreateInput('', 0, 140, 100, 20) GUICtrlCreateInput('', 0, 160, 100, 20) GUICtrlCreateInput('', 0, 180, 100, 20) $dm_End = GUICtrlCreateDummy() GUISetState() Sleep(1000) For $iCtrl = $dm_Start to $dm_End GUICtrlSetState($iCtrl, $GUI_HIDE) Next Sleep(1000) For $iCtrl = $dm_Start to $dm_End GUICtrlSetState($iCtrl, $GUI_SHOW) Next While 1 $gm = GUIGetMsg() Switch $gm Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Edited September 18, 2007 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Fossil Rock Posted September 18, 2007 Author Share Posted September 18, 2007 Interesting ... thanks. Agreement is not necessary - thinking for one's self is! Link to comment Share on other sites More sharing options...
Monamo Posted September 18, 2007 Share Posted September 18, 2007 Individually. Want to see a trick I use though? There are lots of ways to hide groups of controls, but this one is one of my favorites lately. Note: This will only work for controls that are all created one after the other. #include <GUIConstants.au3>[color="#0000FF"][/color] $gui = GUICreate('', 200, 200) $dm_Start = GUICtrlCreateDummy() GUICtrlCreateButton('', 0, 0, 100, 20) GUICtrlCreateButton('', 0, 20, 100, 20) GUICtrlCreateButton('', 0, 40, 100, 20) GUICtrlCreateButton('', 0, 60, 100, 20) GUICtrlCreateButton('', 0, 80, 100, 20) GUICtrlCreateInput('', 0, 100, 100, 20) GUICtrlCreateInput('', 0, 120, 100, 20) GUICtrlCreateInput('', 0, 140, 100, 20) GUICtrlCreateInput('', 0, 160, 100, 20) GUICtrlCreateInput('', 0, 180, 100, 20) $dm_End = GUICtrlCreateDummy() GUISetState() Sleep(1000) For $iCtrl = $dm_Start to $dm_End GUICtrlSetState($iCtrl, $GUI_HIDE) Next Sleep(1000) For $iCtrl = $dm_Start to $dm_End GUICtrlSetState($iCtrl, $GUI_SHOW) Next While 1 $gm = GUIGetMsg() Switch $gm Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Fantastic! I wish I'd thought of that! I typically went through the tedium of building an array list of items in a group and then For...Next'd 'em off and on. - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup] Link to comment Share on other sites More sharing options...
therks Posted September 19, 2007 Share Posted September 19, 2007 That's the way I used to do it, and it's still the best way if you have a group of items that aren't all in a row (or get deleted and regenerated). My AutoIt Stuff | My Github 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