01-28-2009 11:45 AM
Often when we are walking a user through filling out some required information we want to direct their attention to a particular control. The traditional wasy of oing this is to use "key focus" and if more "help" is required maybe change a string control with instruction saying "please fill in your name!". If you really want to get fancy you may even change the background color.
There is now a new approach available but I am not going to tell you what it is (yet). Instead I'll show you!
Run the attached VI (in LV 8.6) and press the highlight button.
The approach I used is in the code but I hid it so you can first ask yourself "how would I have done that?"
So did YOU know this?
Ben
PS To find the answer in the code, please rember that I don't use sequence structes unless I have a reason.
Solved! Go to Solution.
01-28-2009 11:54 AM - edited 01-28-2009 11:54 AM
01-28-2009 01:04 PM
SPOILER ALERT
(Highlight to read)
How come the documentation says "This method works only in Edit Mode"?
01-28-2009 01:49 PM
Wow, that's pretty cool. The ObjHighlight method has been around forever, but only as a private method. Apparently we made it public in 8.6.
As for the help, I filed CAR# 142918 against the LabVIEW documentation, since it appears the method works with running VIs too (also something I didn't know about).
-D
01-28-2009 03:01 PM - edited 01-28-2009 03:04 PM
smercurio_fc wrote:SPOILER ALERT
(Highlight to read)
How come the documentation says "This method works only in Edit Mode"?
I thought about and changed my mind back so you get credit for the solution but....
How did you know that Darren was going to spoil* the game before he did so?
So Darren it looks like you are answering my Q by saying "I would turn on that secret ini token and use...."
Ben
* Just kidding!
01-28-2009 03:18 PM
01-29-2009 07:28 AM
jcarmody wrote:
I knew... I just used that today![]()
Cool! You are way ahead of me. If you run into any complications please let us know.
For those of us who aren't at 8.6 yet and may be wondering what the new method "ObjHighlight" does...
This method when executed invokes the same behaviour we see when we click on a terminal in the block diagram and choose "find control". So now we can use this same behaviour in our apps.
Have fun!
Ben
01-29-2009 07:40 AM
From reading between Darren's lines, the method existed previously and thus if Ben saves a copy for previous versions it will work and the method can be cut and pasted to VIs and used in other versions. Ben, can you save a version 8.5 of this and see if it works and then post it? It would be a nice tool and some of us are stuck at 8.5 until further notice.
01-29-2009 07:53 AM - edited 01-29-2009 07:56 AM
sth wrote:From reading between Darren's lines, the method existed previously and thus if Ben saves a copy for previous versions it will work and the method can be cut and pasted to VIs and used in other versions. Ben, can you save a version 8.5 of this and see if it works and then post it? It would be a nice tool and some of us are stuck at 8.5 until further notice.
Oww you are sharp Scott!
Here it is saved as a invoke node. I did not test it since my 8.5 and 8.6 machines are unique boots of the same machine. If it works we may be able to go bak fartehr than 8.5.
Let me know if it works!
Ben
01-29-2009 08:08 AM - edited 01-29-2009 08:11 AM
Hi Ben,
thank's for sharing it, but in 8.5 it can only be used if the vi is not running.
Attached is the example code.
Mike