[RESOLVED] How to create a radio button on UI-designer

Hi all,

I would like to create and configure a radio button (UI Designer) which provide three values (black, white, grey), but I can’t figure out how to store the user choice in a boolean variable? and to use it in the next task, nor how to display the selected options.

Thanks.

Huh?

Only in the world of Quantum Computing can you consider a variable that can store multiple values like you are asking…

See here: https://www.youtube.com/watch?v=UUpqnBzBMEE

Back to basics though - A Boolean value (see here https://en.wikipedia.org/wiki/Boolean_data_type) has only TWO VALUES.

  • True/False
  • 0/1
  • Black/White

There is simply NO WAY you can make a Boolean value hold anything but one of these values…It cannot happen!

You need to have a INT or a String (length ?) (depending on what you need) that can accept i.e. 1, 2, 3 or A, B, C or even Black, Grey , White or more values…

When you return your radio button you set the variable to the value you have chosen and then use:

if (radioButton.value() == "Black") { Black code } else if (radioButton.value() == "Grey") { Grey code } else if (radioButton.value() == "White") { White code }

regards
Seán

PS: If this reply answers your question, please mark a resolved.

You have some example of radio button in UI Designer in .bos archive ???

Hi,

Boolean = only two values is already (of course) known! Sorry for my wrong description.

It works. Thank you.

Nope, but they are easy enough…just work it through like a select list and everything will become clear.