Sign in to follow this  
Followers 0
hamsteren

how to add ON CHANGE for check box ?

4 posts in this topic

here's my script.

can any1 tell me how i can create an ON CHANGE for my checkboxes ?

#include <GUIConstants.au3>
Dim $software[3][5]
$software[1][1] = "Symantec Anti Virus 10.0"
$software[1][2] = "S:\installer\app001.exe"
$software[1][3] = "c:\Program Files\Symantec Antivirus\vpc32.exe"
$software[2][1] = "Office 2000 + Language Packs"
$software[2][2] = "S:\installer\app002.exe"
$software[2][3] = "c:\program files\Microsoft Office\Office\MSO9.DLL"

global $SSIT_win
$SSIT_win = GUICreate("ECC Software Installer v 2.01b",400,400,-1,-1)
dim $lbl_software[10],$chk_software[10],$lbl_installed[10],$lbl_blank[10]
for $i = 1 to UBound($software)-1 step 1
    $toppos = 10 + ($i*15)
    $chk_software[$i] = GUICtrlCreateCheckbox("",0,$toppos,15,15)
    $lbl_software[$i] = GUICtrlCreateLabel($software[$i][1],15,$toppos,150,15)
    $lbl_blank[$i] = GUICtrlCreateLabel("",165,$toppos,15,15)   
    $lbl_installed[$i] = GUICtrlCreateLabel("",180,$toppos,100,15)
if (FileExists($software[$i][3])) then
    GUICtrlSetBkColor($lbl_software[$i],0x00ff00)
    GUICtrlSetBkColor($chk_software[$i],0x00ff00)
    GUICtrlSetBkColor($lbl_installed[$i],0x00ff00)
    GUICtrlSetBkColor($lbl_blank[$i],0x00ff00)
    GUICtrlSetData($lbl_installed[$i],"Installed")

Else
    GUICtrlSetBkColor($lbl_software[$i],0xff0000)
    GUICtrlSetBkColor($chk_software[$i],0xff0000)
    GUICtrlSetBkColor($lbl_installed[$i],0xff0000)
    GUICtrlSetBkColor($lbl_blank[$i],0xff0000)
    GUICtrlSetData($lbl_installed[$i],"Not Installed")
    GUICtrlSetState($chk_software[$i],1)
    
EndIf
Next
GUISetState()
Do
    $msg = GUIGetMsg()
    if $msg = $chk_software[1] Then
        msgbox(0,"test",guictrlread($chk_software[1]))
    EndIf
Until $msg = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites



here's my script.

can any1 tell me how i can create an ON CHANGE for my checkboxes ?

#include <GUIConstants.au3>
Dim $software[3][5]
$software[1][1] = "Symantec Anti Virus 10.0"
$software[1][2] = "S:\installer\app001.exe"
$software[1][3] = "c:\Program Files\Symantec Antivirus\vpc32.exe"
$software[2][1] = "Office 2000 + Language Packs"
$software[2][2] = "S:\installer\app002.exe"
$software[2][3] = "c:\program files\Microsoft Office\Office\MSO9.DLL"

global $SSIT_win
$SSIT_win = GUICreate("ECC Software Installer v 2.01b",400,400,-1,-1)
dim $lbl_software[10],$chk_software[10],$lbl_installed[10],$lbl_blank[10]
for $i = 1 to UBound($software)-1 step 1
    $toppos = 10 + ($i*15)
    $chk_software[$i] = GUICtrlCreateCheckbox("",0,$toppos,15,15)
    $lbl_software[$i] = GUICtrlCreateLabel($software[$i][1],15,$toppos,150,15)
    $lbl_blank[$i] = GUICtrlCreateLabel("",165,$toppos,15,15)   
    $lbl_installed[$i] = GUICtrlCreateLabel("",180,$toppos,100,15)
if (FileExists($software[$i][3])) then
    GUICtrlSetBkColor($lbl_software[$i],0x00ff00)
    GUICtrlSetBkColor($chk_software[$i],0x00ff00)
    GUICtrlSetBkColor($lbl_installed[$i],0x00ff00)
    GUICtrlSetBkColor($lbl_blank[$i],0x00ff00)
    GUICtrlSetData($lbl_installed[$i],"Installed")

Else
    GUICtrlSetBkColor($lbl_software[$i],0xff0000)
    GUICtrlSetBkColor($chk_software[$i],0xff0000)
    GUICtrlSetBkColor($lbl_installed[$i],0xff0000)
    GUICtrlSetBkColor($lbl_blank[$i],0xff0000)
    GUICtrlSetData($lbl_installed[$i],"Not Installed")
    GUICtrlSetState($chk_software[$i],1)
    
EndIf
Next
GUISetState()
Do
    $msg = GUIGetMsg()
    if $msg = $chk_software[1] Then
        msgbox(0,"test",guictrlread($chk_software[1]))
    EndIf
Until $msg = $GUI_EVENT_CLOSE
Maybe this will work

Do
    $msg = GUIGetMsg()
        for $nm = 1 to UBound($software)-1
        if $msg = $chk_software[$nm] Then
        msgbox(0,"test",guictrlread($chk_software[$nm]) = $GUI_CHECKED)
               exitloop;exit for/next loop
         EndIf
        next

Until $msg = $GUI_EVENT_CLOSE

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Maybe this will work

Do
    $msg = GUIGetMsg()
        for $nm = 1 to UBound($software)-1
        if $msg = $chk_software[$nm] Then
        msgbox(0,"test",guictrlread($chk_software[$nm]) = $GUI_CHECKED)
               exitloop;exit for/next loop
         EndIf
        next

Until $msg = $GUI_EVENT_CLOSE
thanks seems that this works

now what i need is that i get the number of the checkbox but i guess i'll can fix that :)

btw u dutch ?

Share this post


Link to post
Share on other sites

thanks seems that this works

now what i need is that i get the number of the checkbox but i guess i'll can fix that :)

btw u dutch ?

Good

I expect you can

English


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  
Followers 0