Sign in to follow this  
asomer

Deactivation of selection components by visibility

Recommended Posts

Hi, i want to deactivate a selection component (combo box or radio buttons) by following script

component.ComboBox.Visible=0

It disappears when i run the script. Visibility function works fine, but it is still active. You can change the selection when you clicked on invisible component.

Can you advise how I can solve this please?

Share this post


Link to post
Share on other sites

You probably need to set focus to another control.  So, pick another control and do:

component.myComponent.SetFocus()

that should pull focus away from the combo/radio.

Share this post


Link to post
Share on other sites

Visibility function prevents click in button components. If button is invisible, you can't click on it.

1.png.3483b4daf7366f36049de00cbf1d504b.png  
I mean combo box dissappears, but you can still click on it and change the value.

2.png.01ec5eaaef6e41d41de26ba9133edc05.png

Is there any way to prevent click?

Share this post


Link to post
Share on other sites

A couple possible workarounds:

1) put it in a group with another control and then make the group invisible

2) move the component programmatically offscreen to make it invisible, then back onscreen to make it visible.

I prefer the 1st solution, especially if you are making other controls invisible at the same time.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this