Sign in to follow this  
Followers 0
rodsfree

N00B having problems with Radio Buttons and Check Boxes

11 posts in this topic

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.

Share this post


Link to post
Share on other sites



but if it'll help I'll try to clean it up and post it.

please do.

Share this post


Link to post
Share on other sites

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.

Look at Koda form designer in Scite4AutoIt3. It will help you make nice GUI instead nasty one :P

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Oh well that's easy

:P

And I've been trying to figure this out for about a week. DOH!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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

Share this post


Link to post
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! )

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