Jump to content
Sign in to follow this  
Terrified

checkbox

Recommended Posts

Terrified

Sorry for all the posts, if theirs a rule that doesnt allowed many post then tell me ^^

i need help!

how can i make a script, that if one check box is checked it will automatically check another check boxes?

again sry for all the posts, thank you!

Share this post


Link to post
Share on other sites
Josbe

Sorry for all the posts, if theirs a rule that doesnt allowed many post then tell me ^^

i need help!

how can i make a script, that if one check box is checked it will automatically check another check boxes?

again sry for all the posts, thank you!

I don't know if you duplicated posts (Not allowed). But you wrote any of code already?

Proof-of-concept:

Case $myCheckBox1
    If BitAnd(GUICtrlRead($myCheckBox1), $GUI_CHECKED) Then
          GUICtrlSetState($myCheckBox2, $GUI_CHECKED)
          GUICtrlSetState($myCheckBox3, $GUI_CHECKED)
          GUICtrlSetState($myCheckBox4, $GUI_CHECKED)
    EndIf

Share this post


Link to post
Share on other sites
Zinthose

Sorry for all the posts, if theirs a rule that doesnt allowed many post then tell me ^^

i need help!

how can i make a script, that if one check box is checked it will automatically check another check boxes?

again sry for all the posts, thank you!

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

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 105, 48, 492, 184)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 0, 6, 97, 17)
GUICtrlSetOnEvent(-1, "Checkbox1Click")
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 0, 24, 97, 17)
GUICtrlSetOnEvent(-1, "Checkbox2Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    Sleep(100)
WEnd

Func Checkbox1Click()   
    If GUICtrlRead($Checkbox1) = $GUI_CHECKED Then GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
EndFunc

Func Checkbox2Click()
If GUICtrlRead($Checkbox2) = $GUI_CHECKED Then GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
EndFunc

Func Form1Close()
    Exit
EndFunc

--- TTFN

Share this post


Link to post
Share on other sites
FireFox

@Terrified

No problem :)

#Include <GuiConstants_Ex.au3>

GuiCreate("GUI",200,200)
$ck_1 = GuiCtrlCreateCheckBox("ck_1",5,5)
$ck_2 = GuiCtrlCreateCheckBox("ck_2",5,5)
GuiSetState()

While 1
If GuiCtrlRead($ck_1) = $GUI_CHECKED then
GuiCtrlSetState($ck_2, $GUI_CHECKED)
Else
GuiCtrlSetState($ck_2, $GUI_UNCHECKED)
EndIf
WEnd

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
Melba23

@Terririfed,

Try this:

#include <GUIConstantsEx.au3>

$Check_State = 1

GUICreate("Test", 200, 200)

; Create repeat button group
GUICtrlCreateGroup ( "", 10, 15, 175, 65)
Opt("GUICoordMode",0); Relative coords
$Check1 = GUICtrlCreateCheckbox(" Slave 1",  10, 20, 130, 20)
$Check2 = GUICtrlCreateCheckbox(" Slave 2",  -1, 20, 130, 20)
Opt("GUICoordMode",1); GUI coords

; Create checkboxes
$Check3 = GUICtrlCreateCheckbox (" Master ",      10,  10)
    GUICtrlSetState(-1, $GUI_CHECKED)

GUISetState()

While 1

    $aMsg = GUIGetMsg()
        
    If $aMsg = -3 Then Exit
        
; Interaction Repeat checkbox and radio buttons
    If BitAnd(GUICtrlRead($Check3),$GUI_CHECKED) <> $Check_State Then
        $Check_State = Not $Check_State
        If $Check_State Then
            GUICtrlSetState($Check1, $GUI_ENABLE)
            GUICtrlSetState($Check1, $GUI_CHECKED)
            GUICtrlSetState($Check2, $GUI_ENABLE)
            GUICtrlSetState($Check2, $GUI_CHECKED)
        Else
            GUICtrlSetState($Check1, $GUI_DISABLE)
            GUICtrlSetState($Check1, $GUI_UNCHECKED)
            GUICtrlSetState($Check2, $GUI_DISABLE)
            GUICtrlSetState($Check2, $GUI_UNCHECKED)
        EndIf
    EndIf
    
WEnd

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
youknowwho4eva

or use a Radio


Giggity

Share this post


Link to post
Share on other sites
Terrified

Thanks a lot guys. :)

Share this post


Link to post
Share on other sites
Terrified

I need help in some thing else (please)

how can i make a hot key - that when a particular pixel on the screen (219,976) will be in a particular color (0x060606)

it will automatically "send q".

this action will repeat it self over and over until ill close it with another hotkey.

thank you very much!!

Share this post


Link to post
Share on other sites
youknowwho4eva

well your not looking for a hot key. You want a loop that continually checks that pixel with an if statement for that color.


Giggity

Share this post


Link to post
Share on other sites
Terrified

well your not looking for a hot key. You want a loop that continually checks that pixel with an if statement for that color.

yes, but i want a way to control it.

i don't want it to run all the time.

Share this post


Link to post
Share on other sites
Terrified

bump.

please help me :)

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  

×