Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 05 NOV 1997 07:56:20PM J.Wheeler wrote:

How can I set the labels on a group of radio buttons programmatically.

I want one set for each province for example.


At 06 NOV 1997 04:28AM Oystein Reigem wrote:

J,

Let's say you have a radio button group called

"RADIO", with e.g 3 buttons. In Form Designer

you give the radio buttons dummy labels,

e.g "A", "B" and "C". These labels also become

part of the names of the radio buttons.

Then in your programming you can change

the labels to e.g "East", "West" and "North" with

OldVal=Set_Property( @Window : ".RADIO.A", 'TEXT', "East" )

OldVal=Set_Property( @Window : ".RADIO.B", 'TEXT', "West" )

OldVal=Set_Property( @Window : ".RADIO.C", 'TEXT', "North" )

Come to think of it - you might have problems

with the new label not showing correctly!

I remember once I had a radio button group

where I *did* want static values, but still had

to set them to something different in Form Designer

and change them programmatically afterwards.

The problem was: The labels I wanted contained

spaces (or perhaps it was foreign characters,

or perhaps both). Anyway the radio button *names*

became messy. I needed to refer to the radio buttons

programmatically, but the names had become

unusable. So I had to give the buttons more

"neutral" names in Form Designer and change them

programmatically afterwards. But I discovered

that if I used short strings (e.g, "1", "2")

for the labels in Form Designer, my new,

programmatically set labels were truncated!

So I set my labels to "111111111111111111111111111111"

and "222222222222222222222222222222" (I had to

experiment to find suitable lenghts for these

strings) and programmed like this:

OldVal=Set_Property(

  @Window : ".RADIO.111111111111111111111111111111",
  "TEXT", "Særskilt søk på distrikt og adresse" )

OldVal=Set_Property(

  @Window : ".RADIO.222222222222222222222222222222",
  "TEXT", "Parallell søk på distrikt og adresse" )

Yuck! But it worked.

By the way - I have also needed to set the labels

programmatically when I *didn't* need any labels.

I had a horizontal radio button group, and for

some reason I wanted my label texts in a separate

control - a static text - above the group.

Then I gave my 4 radio buttons dummy labels

"1" to "4" and cleared them programmatically

afterwards:

for J=1 to 4

  OldVal=Set_Property( @Window : ".RADIO." : J, 'TEXT', ' ' )

next J

I think I had to use a space and not

the null string.

Good luck!

- Oystein -

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/dad5aae249902e45852565470005286e.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1