Jump to content
sydney

change max value of control dynamically

Recommended Posts

I have an array[6] of controls (SGL data type) and need to reassign the 'max value' of all 6 elements so that the user cannot exceed this value. Normally I would set the 'max value' in the data entry box and be done with it, but this has to be reassigned dynamically once the user has determined this value on the fly. I cannot think of any other way to do this except to use a 'value change?' event to compare the entered value to the present desired 'max value' and force the display to adjust the displayed value as necessary. Anyone have a simpler way to do this?

Share this post


Link to post
Share on other sites

You can use a property node to set the Minimum and Maximum values of the control inside the array. All items in the array will have the same properties (not sure if you care about that).

Share this post


Link to post
Share on other sites

I have an array[6] of controls (SGL data type) and need to reassign the 'max value' of all 6 elements so that the user cannot exceed this value. Normally I would set the 'max value' in the data entry box and be done with it, but this has to be reassigned dynamically once the user has determined this value on the fly. I cannot think of any other way to do this except to use a 'value change?' event to compare the entered value to the present desired 'max value' and force the display to adjust the displayed value as necessary. Anyone have a simpler way to do this?

Create a property node from one of the array elements and use the "Data Entry Limits:Maximum" and "Respone to Value Outside Limits:Maximum" properties. All the array elements will use the new maximum *but* they will keep any old value outside the new max until the user attempts to change that particular element. In other words, they are not immediately coerced; if you want all elements to immediately update, you'll need to do it yourself.

-Scott

Share this post


Link to post
Share on other sites

I did not see a property for min or max. I did find value, which should be spelled in the plural to eliminate confusion, and used that property in a for loop to changed the out of limit values dynamically.

Share this post


Link to post
Share on other sites

I did not see a property for min or max. I did find value, which should be spelled in the plural to eliminate confusion, and used that property in a for loop to changed the out of limit values dynamically.

Here's a snippet what Crossrulz and Scott meant:

post-2399-047157800 1281038452_thumb.png

Ton

Share this post


Link to post
Share on other sites

[i did not realize that there was a RespToOutLimits.Max property! I did find the Max and Min properties, but without coercing that control didn't work as I wanted.

So many properties, so little time. Thanks

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
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.