Jump to content

GUICtrlCreateGroup question


Fossil Rock
 Share

Recommended Posts

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 by Saunders
Link to comment
Share on other sites

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

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