LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting problem in setting key focus property of string.

I am trying to set focus on the string control during my application but some how it is not working. (Attached vi. LabVIEW 7.1)
If I remove the message box popup it works fine. (But I need with message box popup).
 
Can any body help me?
 
thanks.
 
0 Kudos
Message 1 of 13
(4,311 Views)
I got success doing set focus after popping up the message (just connect the output from the msg box vi to the property node) AND swapping assignments in the property node (set focus must be last one). The logic under this is not completely clear to me, but it seems that the set focus must be the very last operation.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 13
(4,302 Views)
Before submitting the post, I tried to do so but it didn't work. Once again I tried on your suggestion, but no success. (I need to press tab one time to get focus on the string control!).
Any idea?
 
 
0 Kudos
Message 3 of 13
(4,296 Views)
You are right, I tried again but this time with no success...
I tried also with a little change, but seems to work only in some cases. It seems that it depends on some hidden initial condition.
For example, if I run the vi when the block diagram is frontmost, the first keyfocus setting is not effective.
It is difficult to obtain a reproducible, reliable behaviour. Sorry, no ideas for now Smiley Sad

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 13
(4,291 Views)

Hi

I could get it to work by adding a small delay before resetting the focus to your string control

This works on my machine running LV8.0

Its all guesswork why its like this but it seems to work but I hope this gives you a workaround.

David

Message Edited by David Crawford on 02-06-2006 05:00 AM

0 Kudos
Message 5 of 13
(4,287 Views)

Hi David,

Thanks for the reply. But it is not working in my system (LabVIEW 7.1) !!

vishal.

0 Kudos
Message 6 of 13
(4,282 Views)

OK it was a bit of a long shot.

Did you try increasing the delay?

Does it work if you run the VI with execution highlight on?

Can post your vi with what you have now?

thanks

David

0 Kudos
Message 7 of 13
(4,273 Views)
Just tried my proposed solution under 7.1 and it doesn't work. They are not the same.
0 Kudos
Message 8 of 13
(4,273 Views)
Another spin ...
 
I am testing this by entering some data in to the string then hitting the <TAB> key to the stop button.
 
I have noticed that the when the event structure finishes it completely removes the current focus which in this is the stop key. If the focus is placed outside the loop. It seems to work on my PC. Give it a try on your machine.
 
I have put in some large'ish delays so that you can watch the focus changing then back to what you want.
 
David
 
VI attached in 7.1
0 Kudos
Message 9 of 13
(4,267 Views)

Hi David,

Thanks for the help. It didn't work as you suggested but while debugging I got another way. (As attached image.) It is not optimum. I also don't know why it is not working as we were approaching previously? (May be some bug.)

If you find some solution on that please let me know.

regards,

vishal

 

0 Kudos
Message 10 of 13
(4,267 Views)