Jump to content

Recommended Posts

Posted

Basically, I want to show or hide GuiCtrlCreateInput depending on the event what end user selects. In my case it is a checkbox check/uncheck.

Thank you for your help!

Posted

#include <GUIConstantsEx.au3>

Dim $hGUI
Dim $Checkbox
Dim $Input

$hGUI = GUICreate('Test', 200, 100)
$Checkbox = GUICtrlCreateCheckbox('Show', 20, 20)
$Input = GUICtrlCreateInput('', 20, 60, 160,23)
GUICtrlSetState(-1, $GUI_HIDE)

GUISetState()
While 1
    Switch GUIGetMsg()
        Case $Checkbox
            If GUICtrlRead($Checkbox) = $GUI_CHECKED Then
                GUICtrlSetState($Input, $GUI_SHOW)
                GUICtrlSetData($Checkbox, 'Hide')
            Else
                GUICtrlSetState($Input, $GUI_HIDE)
                GUICtrlSetData($Checkbox, 'Show')
            EndIf
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
GUIDelete()
Exit

The help file is your friend :) you could save about an half hour if you would take the effort.

Posted

#include <GUIConstantsEx.au3>

Dim $hGUI
Dim $Checkbox
Dim $Input

$hGUI = GUICreate('Test', 200, 100)
$Checkbox = GUICtrlCreateCheckbox('Show', 20, 20)
$Input = GUICtrlCreateInput('', 20, 60, 160,23)
GUICtrlSetState(-1, $GUI_HIDE)

GUISetState()
While 1
    Switch GUIGetMsg()
        Case $Checkbox
            If GUICtrlRead($Checkbox) = $GUI_CHECKED Then
                GUICtrlSetState($Input, $GUI_SHOW)
                GUICtrlSetData($Checkbox, 'Hide')
            Else
                GUICtrlSetState($Input, $GUI_HIDE)
                GUICtrlSetData($Checkbox, 'Show')
            EndIf
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
GUIDelete()
Exit

The help file is your friend :) you could save about an half hour if you would take the effort.

Thank you very much for your help!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...