Jump to content

N00B having problems with Radio Buttons and Check Boxes


rodsfree
 Share

Recommended Posts

Guys,

Like the title says - I'm a n00b with AutoIt and I'm having problems with radio buttons and check boxes.

What I'm trying to do is create a GUI with a group of 3 radio buttons that enable or disable check boxes depending on which radio button is pressed. Allowing you to only select from the check boxes that fit with the selected radio button.

Any help would be appreciated!

I'm not posting the code I've got at this time cuz it looks really nasty - but if it'll help I'll try to clean it up and post it.

Link to comment
Share on other sites

When you say "disable" or "enable" do you mean something along the lines of graying out?

Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

When you say "disable" or "enable" do you mean something along the lines of graying out?

Exactly!!

I've found the GUISetState command and it does the enable and disable thing.

I just haven't figured out how to control that from another control like a radio button.

I'm trying to go through all of the tutorials and snippets that I can find but it's slow going for me. Last time I programed it was in BASIC on my Commadore 128. So, I've got a lot of catching up to do.

Thanks.

Link to comment
Share on other sites

Oh well that's easy

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)
$mainwindow = GUICreate("Test", 300, 160)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState()

$on = GUICtrlCreateRadio ("On", 40, 60, 40, 20)
$off = GUICtrlCreateRadio ("Off", 40, 80, 40, 20)

$checkbox = GUICtrlCreateCheckbox ("", 41, 100, 140, 20)

While 1
    If GUICtrlRead($on) = $GUI_CHECKED Then
        ; Put code for enable here
    EndIf
    If GUICtrlRead($off) = $GUI_CHECKED Then
        ; Put code for disable here
    EndIf
    sleep(10)
WEnd
Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

:P Well I have a knack for programming is all, I only started AutoIt less than a month ago.

Believe it or not, I program CNC machinery and Coordinate Measuring Machines for a living.

But that is an entirely different kind of thing than this.

Thanks again.

rodsfree

Link to comment
Share on other sites

Again, people lower my moral with such ease :P

But I also have some previous programming skills, though not nearly as cool as your's

Edited by BALA
[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
Link to comment
Share on other sites

Again, people lower my moral with such ease :P

But I also have some previous programming skills, though not nearly as cool as your's

Well,

If you ever want to know anything about G & M code, UMESS-ux, UMESS-300, PC-DMIS, or SolidEdge...

Let me know and I'll be happy to help out!

Cutting chips isn't as cerebreal as PURE programming, like AutoIt is.

I can see my machines move to my program and it's a LOT easier to see where you mess up. Sometimes with loud bangs when you try to move THROUGH a piece of solid steel. LOL

(I keep a spare pair of tighty whities in my desk! )

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