Jump to content

Checkbox Example?


Swift
 Share

Recommended Posts

Well...I have no clue why this is isnt working....but does anyone have a example of a GUI with a checkbox...that when checked will Enable an input...when unchecked with disable it?

I dont get why what im doing wrong...a little sample

While 1

$msg = GUIGetMsg()

Select

$msg = $check (checkbox)

GUICtrlSetState($input, $GUI_DISABLE)

and the helpfile isnt helping...it created a checkbox...Wooo!! so helpfull >.>

but...if anyone has a example...it'd be apperciated.

Link to comment
Share on other sites

Like this?? (and btw I learned this by reading the help-file :) )

#include <GUIConstantsEx.au3>

GUICreate("Test", 200, 100)
$Input = GUICtrlCreateInput("This is an input", 10, 10, 180, 30)
GUICtrlSetState(-1, $GUI_DISABLE)
$Box = GUICtrlCreateCheckbox("this is a checkbox", 10, 60, 180, 30)
GUISetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Box
            If GUICtrlRead($Box) = $GUI_CHECKED Then GUICtrlSetState($Input, $GUI_ENABLE)
            If GUICtrlRead($Box) = $GUI_UNCHECKED Then GUICtrlSetState($Input, $GUI_DISABLE)
    EndSwitch
WEnd
Link to comment
Share on other sites

Yay...what I needed...Yes...I read the helpfile..wanna know what it says?

this is the example...

#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput ( "", 10,  5, 300, 20)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)
GUICtrlCreateInput ("", 10,  35, 300, 20)  ; will not accept drag&drop files
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
       Select
           Case $msg = $btn
               exitloop
       EndSelect
Wend

MsgBox (4096, "drag drop file", GUICtrlRead($file))
Link to comment
Share on other sites

Yay...what I needed...Yes...I read the helpfile..wanna know what it says?

this is the example...

#include <GUIConstants.au3>

GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES
$file = GUICtrlCreateInput ( "", 10,  5, 300, 20)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)
GUICtrlCreateInput ("", 10,  35, 300, 20) ; will not accept drag&drop files
$btn = GUICtrlCreateButton ("Ok", 40,  75, 60, 20)

GUISetState () 

$msg = 0
While $msg <> $GUI_EVENT_CLOSE
       $msg = GUIGetMsg()
       Select
           Case $msg = $btn
               exitloop
       EndSelect
Wend

MsgBox (4096, "drag drop file", GUICtrlRead($file))

You have to look at more than one example.

You set your criteria.

Look at each part of the criteria and find a match or close match in the help file, then piece it together.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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