Notifications
Clear all

[Closed] enable/disable radiobuttons??

In common programs, I often see disabled radiobuttons which are only selectable after clicking a required feature for example.

My idea is to check if a checkbox is checked or not, and, depending on the checkbox’ state I would let those radiobuttons be accessible or even not.

This Thread slightly goes hand-in-hand with this one: http://forums.cgsociety.org/showthread.php?f=98&t=481656

But the feature should be different.

2 Replies

Hi,

Here is an example showing how to enable/disable a control depending on a checkbox state:

(
	rollout rollExample "Checkbox Example"
	(
		checkbox chkTest "Enable Radiobuttons"
		radiobuttons radTest labels:#("Radio1", "Radio2", "Radio3") default:1 enabled:false
		
		on chkTest changed state do
		(
			radTest.enabled = state
		)
	)
	
	try(destroyDialog rollExample)catch()
	createDialog rollExample
)

Hey, thanks. That did the trick.

Controlling the state of the Checkbox was the key to success.