Jump to content

Trouble getting started with Radio Buttons


Recommended Posts

Thanks to all of you who have answered my questions in the past. Psalty will be happy to learn that I am on to a new script.

This one should be quite simple. All I want is to list computers in a GUI, allow the user to select the computer they want to share to and click a button to make the connection. I have thought about radio buttons and have checked the GUICtrlCreateRadio sample but I'm afraid that may be to much once the list of choices grows to 15 or 20. So I thought about GUICtrlCreateCombo and that seems like a more logical choice.

My problem is I'm not really sure how to get started. I could move forward using the GUICtrlCreateRadio example but I don't know how to make the thing wait for a button click. I would assume that whether coming from a radio button or a combo box list, the actual code that makes something happen would be similar.

I'm pretty good a picking things up once they have been dumbed down a bit and most of what I have read doesn't make much sense to me. If anyone feels like helping out an old desktop support guy I sure would appreciate a push in the right direction.

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Link to comment
Share on other sites

Indeed - to create a combobox will be much easier since you could have so many choices.

I'm wondering if you're using OnEventMode.

If you do the I could help you with this because I've used that myself.

Anyway here is a sample of what you can do:

$combo = GUICtrlCreateCombo("", coords here, coords here, coords here, coords here, BitOR($CBS_DROPDOWNLIST, $WS_VSCROLL, $CBS_SORT))
GUICtrlSetOnEvent(-1, "comboChange")

This will make your combo to be readonly and sorted.

then you can make a function to do whatever you want when something change in the combobox (something is selected)

Func comboChange()
Switch GUICtrlRead ($combo)
       Case content1
               do stuff here
       Case content2
               do other stuff here
... and so on ....
EndSwitch
EndFunc

This is OnEventMode but you can rewrite the code to get what is the best for you.

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

Thanks for the input. I will give this a shot in the morning.

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

Link to comment
Share on other sites

I have spent much of the day trying to make this work and finally got a simple message loop to function. It seems that I cannot comprehend OnEventMode at this time. Thanks for the tip though.

Support bacteria; it's the only culture most people have.LxP's Learning to Script with AutoIt 3 - Excellent starting placeVolly's Links Page - Links to cool and useful scriptsAutoIt Wrappers - Valuater's AutoIt Wrappers post. Lots of good stuff.Support AutoIt - Make a donation here; I did.[size="2"]#include <Guinness.pint>[/size]

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