LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to limit input on a table control programmatically?

I like to limit the user input to a number of X charakters. Therefore I created a table control on the front panel. On the diagram I draw a while loop and put a property node inside (referencing the table control, of course). I use "EditPos" to get the recent editing position and the "value" property to get the data array, from which I extract the value, which is recently edited on the front panel. Then I measure the string's length and cut it to my favoured length (X). Afterwards I write the cutted string back to the table using the invoke node's method "Set Cell Value".

Unfortunatly the string value won't be updated while editing it, therefore this method doesn't work. Does anyone have suggesti
ons on updating a value "just in time"??

thanks for helping
chris
0 Kudos
Message 1 of 3
(3,406 Views)
The answer your looking for is a right click away. Right click on your string control, at the bottom there should be a selection "update value while typing"
this is what you want.
0 Kudos
Message 2 of 3
(3,406 Views)
For a string certainly. The table control in the message? Nope.

There's a range of solutions to this problem and none of them are trivial.
Is it really an issue given that the string length restrictions are applied
when the user presses return in any case?

If it's a real issue two solutions spring to mind. The first is to watch for
table cells becoming active- when one does, move a previously hidden string
control of the same size as a table cell over the cell and give it key
focus. You could also copy the contents of the cell into it and select it
all so the user either overtypes or edits. Don't make the user explicitly
delete the text- that gets incredibly annoying. The string control then
handles the real-time validation of input, and when return is pre
ssed the
string is copied back to the table and the control made invisible/moved off
panel again.

The second is to use M$, via the ActiveX containers. There are several
controls that would be suitable but unless you're familiar with using them
already in Visual Basic/Visual C++ it's probably too much effort learning
how to use them.

Dr. Spite wrote in message
news:506500000005000000902B0000-986697009000@quiq.com...
> The answer your looking for is a right click away. Right click on your
> string control, at the bottom there should be a selection "update
> value while typing"
> this is what you want.
0 Kudos
Message 3 of 3
(3,406 Views)