LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to restrict the user to type in a control node?

I would like to make a long string .For a half of the string ,I would like it to be fixed and cannot deleted by the others.For the other half of the string, I would like it to be changable. I am wondering whether there is special proporty node for the string to do it.
 
Just like some file path, half of the path name is fixed and cannot be changed by the user but ,for the other half , the user can type in the file name that they want.
 
Thanks
 
 
0 Kudos
Message 1 of 6
(2,931 Views)

Just use two controls. One would be disabled (or an indicator) and the other would be the one the users type in. If you want it to make it look like a single controls you can make one transparent and overlay it, but I would advise against that, because it would be highly dependant on font size.

Another option is to have a single control and use a Key Down? event. If the beginning of the string does not match your set string, discard the event. Note that you will need to set the string to update while typing for this to work.


___________________
Try to take over the world!
Message 2 of 6
(2,920 Views)
Thanks for your reply.
Actually I have tried the first method but the result does not seen very goodSmiley Sad
 


 

 
0 Kudos
Message 3 of 6
(2,897 Views)

I couldn't look at your code (7.0 here), but here is an example of the second option, which is actually slightly more complicated than I originally thought, because the event does not change the string until you accept it. Instead, I tested for the position of the cursor. This does not actually test the string, only the length, but it should probably be OK.

In any case, this interface sounds weird to me. Can you show a mockup of how you actually want it to look?


___________________
Try to take over the world!
0 Kudos
Message 4 of 6
(2,887 Views)
Sorry, here it is.

___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(2,885 Views)
Thanks for your reply.The programme is very useful.Thanks a lot.Smiley Wink
0 Kudos
Message 6 of 6
(2,867 Views)