Converting checkboxes into radio buttons via code

Hi, guys,

I am creating a simple test application to test a concept.

There are two radiobuttons: “View” and “Edit”, and there are three checkboxes, CheckBox1, CheckBox2, and CheckBox3.

When the “View” radio button is selected, I need the checkboxes to function as checkboxes.

When the “Edit” radio button is selected, I need checkboxes to function as radio buttons i.e. whatever checkbox is clicked, it unchecked the other ones.

Apparently, changing CheckBox.Value=True to CheckBox.Value=False does not work. I found an example in the Language Reference on how to use Select Case.

I’ve placed this test project named “CHECKBOXES” into a DropBox folder.

https://www.dropbox.com/sh/rpflgjs40s5xbap/AACSThvOLj4hnkF7TEPhgHuua?dl=0

Everything works in the project but for some reason, the CheckBox remains checked when I select “Edit” radio button regardless an explicit command to have it unchecked.

Any help is greatly appreciated.

Thank you,

Val

Solved the problem by addressing the visual states via the radio buttons rather than the values of the checkboxes.

It is possible to make a checkbox look like a radio button with a declare on the macOS. However you don’t get the rest of a true radio button functionality for FREE.

I would advise against actually doing this, because they’re two different controls for two different purposes.

  1. Checkboxes allow for multiple options to be selected.
  2. Radio buttons only allow for one option to be selected.

Hi, Sam,

Thank you for your reply.

Those two different purposes are exactly why I want checkboxes to act as checkboxes and radiobuttons based on which radio button is selected.

Val

What about using two Controls , then clone the one you need and use the cloned ones ?

When your “EDIT” radiobutton is selected… simply UNCHECK all the checkboxes, and then CHECK the one you just selected

Of course you have an indeteminate state if “VIEW” is selected, and multiple checkboxes are checked and you then click on “EDIT” as it then won’t know what state to move the checkboxes to.

Sure it does… .I use this all the time

[quote=468381:@Dave S]When your “EDIT” radiobutton is selected… simply UNCHECK all the checkboxes, and then CHECK the one you just selected

Of course you have an indeteminate state if “VIEW” is selected, and multiple checkboxes are checked and you then click on “EDIT” as it then won’t know what state to move the checkboxes to.

Sure it does… .I use this all the time[/quote]

He already said that is solved.

Just put CheckBoxes in one page of a PagePanel and RadioButtons in another. Change the page depending on the status of “View” and “Edit”