LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

key focus/focus&precision

I have a case in one of my VIs that when met, a particular numerical control becomes key focused via a property node. However, the precision of the number is two decimal places. the key focus on highlights thru one decimal place, making it necessary to use the
delete key. Not that it's that big of a hassle, but it would be nice for the user not to have to do that, but just to enter the case, and type in the number.
thanks in advance.
0 Kudos
Message 1 of 8
(3,375 Views)
Use the Numeric Control property called NumText.Selection, it will do want
you need.

"uc_greg" wrote in message
news:506500000008000000FB4C0000-1023576873000@exchange.ni.com...
> I have a case in one of my VIs that when met, a particular numerical
> control becomes key focused via a property node. However, the
> precision of the number is two decimal places. the key focus on
> highlights thru one decimal place, making it necessary to use the
> delete key. Not that it's that big of a hassle, but it would be nice
> for the user not to have to do that, but just to enter the case, and
> type in the number.
> thanks in advance.
0 Kudos
Message 2 of 8
(3,375 Views)
Tried that, didn't work. Set NumTextSelection:End to include the whole number, and it still left off the last digit. It works as expected if set to a number less than the last digit, but when set equal to or greater it doesn't work. very frustrating. tried changing the format/precision of the number in the control as well, but it still didn't work. thanks anyway.
0 Kudos
Message 3 of 8
(3,375 Views)
I'm using LabView 5.1.1 and I was not able to reproduce your problem. When I set the focus on the numerical control via the property node it becomes highlighted for the 2 decimals, no need to delete.

Can you post an example of the problem so that we can try to find what's wrong with it ?
0 Kudos
Message 4 of 8
(3,375 Views)
my version is 6i. i have not been able to reproduce the problem in a separate vi. the text selection in the property node works fine. however, in the program that was having the trouble, I tried replacing the old numerical control with a new one, and that still didn't work. i'd send on the program, but it's huge and it involves drivers for a DAQ board...won't run without said drivers and said board. the only thing that might be messing it up that i can figure is that the #s in the control are of a larger font. that being said, i tried a smaller font and it still didn't work.
0 Kudos
Message 5 of 8
(3,375 Views)
my version is 6i. i have not been able to reproduce the problem in a separate vi. the text selection in the property node works fine. however, in the program that was having the trouble, I tried replacing the old numerical control with a new one, and that still didn't work. i'd send on the program, but it's huge and it involves drivers for a DAQ board...won't run without said drivers and said board. also, the #s in the control are of a larger font. that being said, i tried a smaller font and it still didn't work. the only thing that might be messing it up that i can figure is that the key focus is being fired on the first iteration of that case, and each iteration thereafter needs the number. we're running at about 100 Hz. perhaps the key focus won't "g
rab" the entire number if the numerical control is being accessed...makes no sense, but maybe.
0 Kudos
Message 6 of 8
(3,375 Views)
If you just cut and paste that control and its attribute node in a seperate vi it works fine ?

BigBen
0 Kudos
Message 7 of 8
(3,375 Views)
Try this:
Set the precision to 2 decimal using an attribute node just before setting the focus on that control.
May be that will solve the problem if you are setting the focus when the precision is 1 and changing it to 2 later in the program.

BigBen
0 Kudos
Message 8 of 8
(3,375 Views)