Jump to content

How to disable an element in an array


Recommended Posts

For building certain GUIs we are using array in which controls are used. Some columns/araays contain numbers, others buttons and so on. I like to know if and how it is possible to diable some element in such an array, for example by using attrribute or so. Can anyone advice?

If possible working in LV6 otherwise 7.0

Link to comment

To my knowledge it is not possible to change the attributes (enabled) of one element in an array. The attributes are common for all elements of the array.

If you wanted to change the attributes of an element, you would have to know at design-time which element to change. But the array itself is filled with data only at run-time.

... Imagine you have an array of 5 elements. You have wired your vi the way that the 7th element is disabled. This isn't goning to work!!! :nono:

Didier

Link to comment

Is the length of the array going to be limited?

How big can it actually get.

There are some creative solutions that you can implement, but most can not be used on an array that has a large and/or indefinite length.

What is the interface trying to accomplish?

This question may also bring about other solutions.

Link to comment
Is the length of the array going to be limited?

How big can it actually get.

There are some creative solutions that you can implement, but most can not be used on an array that has a large and/or indefinite length.

What is the interface trying to accomplish?

This question may also bring about other solutions.

Yes, for example, if only 10 elements are visible at a time then you can overlay 10 transparent booleans overtop each element of the array. Using logic you can enable\disable each boolean for the coresponding element of the array that needs handling.

Link to comment

There are many solutions.

If you display one element at a time, you can enable/disable the control depending of the element displayed.

If you display few elements, don't display the array but a subset of the array in a cluster where you can enable/disable elements individually.

Or add an transparent/disable boolean indicator in the array element. Edit the boolean so that it is very small when false, and large enough to cover other elements when true (on top). Then you can "disable" the element individually by setting the covering boolean to True. This may not be convenient for large amount of data.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.