Jump to content

Value for Check Boxes


firman
 Share

Recommended Posts

I am writing a program with check boxes so I can select what programs I want to install...

it goes like this:

#include <GUIConstants.au3>

GUICreate("Installs for Computers", 600, 300)

GUICtrlCreateLabel("Installs for Computers", 30, 10)

$norton_managed = GUICtrlCreateCheckbox ("Norton Managed", 10, 10, 120, 20)

$adobe_reader = GUICtrlCreateCheckbox ("Adobe Reader", 10, 30, 120, 20)

$adobe_writer = GUICtrlCreateCheckbox ("Adobe Writer", 10, 50, 120, 20)

$vnc = GUICtrlCreateCheckbox ("VNC", 10, 70, 120, 20)

$logo_arc = GUICtrlCreateCheckbox ("Arc Background", 10, 90, 120, 20)

$okbutton = GUICtrlCreateButton("OK", 70, 275, 60)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

Select

Case $msg = $okbutton

MsgBox(0, "GUI Event", "The Installs will now begin")

If $logo_arc = $GUI_CHECKED THEN <-- PART THAT IS WRONG -->

Runwait ("\\dell06\installs\logoarc\logoarcdisplay.exe")

EndIf

Case $msg = $GUI_EVENT_CLOSE

MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")

ExitLoop

EndSelect

WEnd

I need to know what the value of $logo_arc is so that I can see if it should run or not. How do I do that?

Link to comment
Share on other sites

When you want to read a GUI Control, you need to use GUICtrlRead.

#include <GUIConstants.au3>


GUICreate("Installs for Computers", 600, 300) 
GUICtrlCreateLabel("Installs for Computers", 30, 10)
$norton_managed = GUICtrlCreateCheckbox ("Norton Managed", 10, 10, 120, 20)
$adobe_reader = GUICtrlCreateCheckbox ("Adobe Reader", 10, 30, 120, 20)
$adobe_writer = GUICtrlCreateCheckbox ("Adobe Writer", 10, 50, 120, 20)
$vnc = GUICtrlCreateCheckbox ("VNC", 10, 70, 120, 20)
$logo_arc = GUICtrlCreateCheckbox ("Arc Background", 10, 90, 120, 20)


$okbutton = GUICtrlCreateButton("OK", 70, 275, 60)
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()

Select
Case $msg = $okbutton
MsgBox(0, "GUI Event", "The Installs will now begin")

If GUICtrlRead($logo_arc) = $GUI_CHECKED THEN <-- PART FIXED

Runwait ("\\dell06\installs\logoarc\logoarcdisplay.exe")
EndIf

Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "GUI Event", "You clicked CLOSE! Exiting...")
ExitLoop 
EndSelect
WEnd

:lmao:

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