Jump to content
Sign in to follow this  
c4mpi

Get Checkbox Value then

Recommended Posts

c4mpi

Hi, Im playing around with the checkbox utility and I want to make a simple "launcher"

Here is what Ive come up with

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 233, 209, 192, 124)
$Group1 = GUICtrlCreateGroup("Oppsett", 16, 16, 193, 161)
$Checkbox1 = GUICtrlCreateCheckbox("1", 104, 48, 97, 17)
$Checkbox2 = GUICtrlCreateCheckbox("2", 104, 72, 97, 17)
$Checkbox3 = GUICtrlCreateCheckbox("3", 104, 96, 97, 17)
$Checkbox4 = GUICtrlCreateCheckbox("4, 104, 120, 97, 17)
$Button1 = GUICtrlCreateButton("OK", 104, 144, 75, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
        If $Checkbox1 > 1 Then Run("notepad.exe")
    EndSwitch
WEnd

But what this code does is start notepad on button click.

I want it to check what checkboxes is checked and start notepad if checkbox1 is checked

Share this post


Link to post
Share on other sites
99ojo

Hi,

If GuiCTRLRead ($Checkbox1) = $GUI_CHECKED Then

;-))

Stefan

Share this post


Link to post
Share on other sites
somdcomputerguy

Use If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then Run("notepad.exe")

Edit: I'm a slow typer.. :(

Another Edit: This'll work too,

If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then Run("notepad.exe")

Edited by snowmaker
  • Like 1

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.