Jump to content

Disabling checkboxes


faldo
 Share

Recommended Posts

Could anyone be as kind as to post a short snippet of 4 checkboxes where the 4th one disables the 3 first ones... as in the user not being able to choose them when the 4th box it checked.

Also, when the 4th box is checked, the other 3 gets checked automaticly.

ie.

[]program 1

[]program 2

[]program 3

[]All programs

Thanx in advance.

Link to comment
Share on other sites

search the forum for GUICtrlCreateCheckbox. You will immediately find some examples.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

#include<guiconstants.au3>
$main = guicreate ("Main", 300, 300)
$cb1 = guictrlcreatecheckbox ("Checkbox1", 10, 10)
$cb2 = guictrlcreatecheckbox ("Checkbox2", 10, 40)
$cb3 = guictrlcreatecheckbox ("Checkbox3", 10, 70)
$cb4 = guictrlcreatecheckbox ("Checkbox4", 10, 100)
guisetstate()
while 1
$msg = guigetmsg()
if $msg = $GUI_EVENT_CLOSE then
exit
endif
if guictrlread($cb4) = 1 then
if guictrlgetstate($cb3) = 80 Then
guictrlsetstate ($cb1, $GUI_CHECKED + $GUI_DISABLE)
guictrlsetstate ($cb2, $GUI_CHECKED + $GUI_DISABLE)
guictrlsetstate ($cb3, $GUI_CHECKED + $GUI_DISABLE)
EndIf
else
if guictrlgetstate($cb3) = 144 Then
guictrlsetstate ($cb1, $GUI_ENABLE)
guictrlsetstate ($cb2, $GUI_ENABLE)
guictrlsetstate ($cb3, $GUI_ENABLE)
EndIf
endif
wend

you have to uncheck all cb by yourself

Edited by Nuffilein805
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...