Jump to content
Sign in to follow this  

Problem with checkbox

Recommended Posts


hello i have a problem with my software, when i try to make a condition

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Func Install()

    Local $Button_1, $msg, $Pic1, $Form1, $chkbox_1

    $Form1 = GUICreate("Office 2010 Installer v1.2", 628, 459, 185, 124)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Button_1 = GUICtrlCreateButton("Installer", 64, 376, 137, 49, $WS_GROUP)
    $chkbox_1 = GUICtrlCreateCheckbox("Ajouter Microsoft Access", 64, 336, 153, 17)
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    $Pic1 = GUICtrlCreatePic("C:\I386\Office2010+\13.jpg", 0, 0, 625, 457, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

    While 1
        $msg = GUIGetMsg()
            Case $msg = $GUI_EVENT_CLOSE
            Case $msg = $Button_1

                    If GUICtrlRead($chkbox_1) = $GUI_UNCHECKED Then
                        SplashTextOn("Patientez...","Installation d'Office 2010","300","50","1100","60",32,"","","")
                           RunAsWait($sUserName, $sDomain, $sPassword, 1, "setup.exe /adminfile Updates\office.MSP")
                    Elseif GUICtrlRead($chkbox_1) = $GUI_CHECKED Then
                        SplashTextOn("Patientez...","Installation d'Office 2010 + Access","300","50","1100","60",32,"","","")
                            RunAsWait($sUserName, $sDomain, $sPassword, 1, "setup.exe /adminfile Updates\officeaccess.MSP.MSP")
                    msgbox(0,"", "Installation Termin√© !")


for explain i have a checkbox, for installing or not office access with two different .MSP, but with or without the checkbox he install office access

if someone can explain me the problem or can give an example thx in advance !

Share this post

Link to post
Share on other sites

have you tried _GUICtrlButton_GetCheck instead of GUICtrlRead??

if its checked, it will return $BST_CHECKED


EDIT: but if you r just using it in an if statement like above, you can just use _GUICtrlButton_GetCheck($chkbox_1) and it will count as checked

Edited by Kidney

Share this post

Link to post
Share on other sites

thx for help but i don't know how to construct my condition ^^ if u can put me on the way ! thx

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