LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

setting focus for control in subpaneled vi

Hi All,
 
I have a VI I am running in a subpanel.  Doing all kinds of spiff user interface stuff but I've hit a wall. 
 
For my one event handler on the name change for a channel, if the name is invalid (given special criteria) I send an error message to the user, replace the name string control with the old text and reset the key focus to that control with the old text highlighted.  See picture...
 
The problem comes with the 1 button dialog box.  When that is not included, the keyfocus and text highlight work fine.  After I add the 1 buttone dialog box, after I OK out of it the highlight and keyfocus do not occur. 
 
Note that I tie the "true" output of the 1 button dialog to the Keyfocus input the ensure that property node cannot execute until the dialog has exited.
 
Any input appreciated.
 
Cheers,
Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 1 of 5
(3,076 Views)
What version of LV are you using and can you attach the smallest code snippet possible that can create this unexpected behavior?  I imagine there is some kind of work-around for this (to force the focus despite the dialog).
0 Kudos
Message 2 of 5
(3,060 Views)

Ok, here is the additional info.

I'm running LabVIEW 8.  A simple VI example is attached.  Interesting to note:  This VI works on one box with Windows 2000 but does NOT on Windows XP.  The WinXP box also has the upgraded 8.0.1 patch.  I'm going to add that to the Win2k box and see if that is the issue.

Thanks for the follow-up.

Cheers,

Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 3 of 5
(3,051 Views)
It's usually best to place the control whose event is being triggered in the event case that's handling it.  So try placing the "Name" control terminal icon in the "'Name': Value Change" case.
 
Overall, I was not able to reproduce the behavior consistently (Windows XP and LV 8.0) before moving the control terminal icon in the event case.  The behavior was not a problem ever after moving it.
 
Hope this helps!
0 Kudos
Message 4 of 5
(3,042 Views)

No joy.  Though I agree on the control within the event handler.  Bad practice on my part.

Without the 1 button dialog, it works as advertised.  With it, the focus never returns.

I have the "old" look and feel on the WinXP box.  I'm going to see if that may be the issue.

I appreciate the quick feedback.

Cheers,

Greg Cole
“It is not the ship so much as the skillful sailing that ensures the prosperous voyage.”
0 Kudos
Message 5 of 5
(3,036 Views)