LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get rid of the Key Focus object border?

I have some string controls which I have made transparent for a reason.  It turns out that when the controls are set as the key focus object for the front panel (either programatically or via the tab key) that LabVIEW wants to draw a border around it.  This is annoying.  Anyone know how to get rid of this?  I've tried setting all the color properties and many other things.
Message Edited by JS at ARC on 01-30-2009 09:11 AM
CLA, CCVID, Certified Instructor
0 Kudos
Message 1 of 8
(3,865 Views)

I ran into this same problem while working on Quick Drop in LabVIEW 8.6.  I discovered a solution...you can put a simple rectangular decoration around the control.  Color the inside transparent, and color the border to match your VI panel.  Make the decoration be the exact same size as the key focus border that appears around the control.  That's it!  I've attached a VI below saved in 8.0 that demonstrates this technique (using the same Combo Box that I use in Quick Drop!).  Maybe I'll make a nugget out of this someday.

 

-D

 

 

Message 2 of 8
(3,833 Views)
Unfortunately that solution will not work for me.  Ultimately the border will overlap another control as well as the panel's background.  I'd like to find a solution that allows me to keep my current design (not shown in the screen cap for legal reasons).
CLA, CCVID, Certified Instructor
0 Kudos
Message 3 of 8
(3,825 Views)

I don't know of any other solution.  I agree that it would be useful to turn off the Key Focus box...please submit your feedback to the Product Suggestion Center so we can evaluate it for possible inclusion in a future LabVIEW release.

 

-D

0 Kudos
Message 4 of 8
(3,821 Views)
This is a very anoying problem, and there isn't a good solution, as far as I
know (and I did search for it a lot in the past).

The only thing you can do, is put a decoration around it in the same color
as the background. When your window has a custom color, this is fairly easy,
but still it gets old soon... It gets in the way of clicking on the
controls, and it is a big hassle to resize controls. You might be able to
automate this with VI server, but it will take a lot of time to get it
working correctly.

Since the background color might change (if you use windows colors), you
have to change the color of the decorations. You can't simply retreive the
background color, but you can get the window bg color from windows, using an
api. Next problem is you can't label decorations, or get static references
from it, so you have to go through all decorations (property of front
panel), and by index recolor the correct decorations.

So, I think it's time for NI to work on this, since it can destroy nice
interfaces.

Regards,

Wiebe.


0 Kudos
Message 5 of 8
(3,817 Views)
The only solution would be to try to detect when a new control gets focus.
Then, get an image of that control, and it's immedeate surrounding. Then,
you'll have to place 2 one pixel high picture control and 2 one pixel wide
picture controls around it... It might just work, if you get it to work! Not
sure if it's wurth the effort.

Regard,

Wiebe.


0 Kudos
Message 6 of 8
(3,814 Views)

Hi All,

 

Has anybody got a solution or atleast a workaround for this problem? I do not wish to place any decoration on my controls in order to remove the highlight border as mentioned in the thread. Is there any other way in which the problem can be solved? I want this for my string control which shows this border when KeyFocus is True. In addition to that border, there is a flashing cursor. I wish to have this cursor alone and remove the border.

 

I was also thinking that when something is typed in a control, then the keyfocus automatically moves to it (confirmed using the property node). But in this case there is no border. So is there a way of simulating this condition when the user tabs over the screen controls?

 

Thanks,

Priyadarsini S

0 Kudos
Message 7 of 8
(3,266 Views)

Hi Priyadarsini,

 

Sorry, but it looks like there still is not a good fix for this.  Like Darren said a couple posts ago, please feel free to submit this to the Product Suggestion Center.  Good luck!

Jeff S.
National Instruments
0 Kudos
Message 8 of 8
(3,251 Views)