Radio Button selected by default

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
TubooBokBok
Posts: 19
Joined: Wed Jun 18, 2014 7:23 pm

Radio Button selected by default

Post by TubooBokBok » Wed Jul 09, 2014 5:50 pm

Hi I have a card with 3 radio buttons. I want one of the buttons to be selected automatically as soon as my program is run. I tried selecting the default button option in the properties tab but it doesn't seem to do anything Can any help?

Thanks.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: Radio Button selected by default

Post by magice » Wed Jul 09, 2014 5:56 pm

Which ever one is selected when the app is saved to a stand alone should be the default when the app is run.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Radio Button selected by default

Post by Klaus » Wed Jul 09, 2014 5:58 pm

Hi TubooBokBok,

I am sure you have GROUPED your radio buttons! 8)

Then you can set and get "the hilitedbutton of grp XYZ", which is the number of the (target) button,
or "the hilitedbuttonname of grp XYZ", which is the NAME of the (target) button.

Example:

Code: Select all

group "yourRadioButtons
  button "radio1" ## Which is the FIRST button = 1 in the group
  button "radio2" ## button # 2
  button "radio3" ## button # 3
Now if you want to hilite the second button "radio2", you have 2 options:
...
set the hilitedbutton of grp "yourRadios" to 2
...
or
...
set the hilitedbuttonName of grp "yourRadios" to "radio2"
...
Both will hilite the second button "radio2", now choose what fits your situation :D


Best

Klaus

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Radio Button selected by default

Post by Klaus » Wed Jul 09, 2014 5:59 pm

magice wrote:Which ever one is selected when the app is saved to a stand alone should be the default when the app is run.
Yep, or this way :D

TubooBokBok
Posts: 19
Joined: Wed Jun 18, 2014 7:23 pm

Re: Radio Button selected by default

Post by TubooBokBok » Wed Jul 09, 2014 6:01 pm

Awesome thanks alot guys

Post Reply