08-11-2021 08:17 AM
Hi guys,
I have some black buttons over a black background and when I navigate to them with Tab, the usual black square that highlights the control is invisible.
Is that black square editable in some way? It would be nice to give it the same appearance as when you hover over the button with the mouse. Is the Key Focus property the only way to achieve this?
Thanks in advance!
08-12-2021 02:42 AM - edited 08-12-2021 02:43 AM
Hi JoePerkins,
Key Focus should holds good for you to highlight button borders, Any Reason why you need some other options other than Key Focus.
If you want to highlight only button borders, hope key focus is the better option.
08-12-2021 02:54 AM
Well, if that appearance could be customized in the control, I would avoid adding code.
08-12-2021 04:14 AM
Just change the co lour of the control, that should help
08-12-2021 04:28 AM
Of course, but that's not an option.
08-12-2021 10:57 AM
Why is "black on black" something you can't change? Seems like a silly requirement to me. (I know you're constrained by this silly requirement, so I'm not disparaging you.) Can you make it a custom control/typedef and recolor the border?
08-13-2021 01:32 AM
The idea is to not break the (questionable) color design of the application, so I'm stuck with black on black.
08-15-2021 02:48 AM
I would consider adding another disabled button or indicator with the color you want which would be in the background and then positioning it at the correct location and size to serve as the border.
The tricky part is knowing when to position it. You could use mouse and key down/up events on the FP to trigger a search through all of the controls to see which one has the key focus. If you put all of this in a subVI, then it even doesn't make your code very ugly and you can use it for multiple VIs. You would just need to stop the VI.
Also, here is a previous discussion on the topic with links to some other related discussions (although they're not exactly the same as what you want):
https://forums.ni.com/t5/LabVIEW/Changing-Key-Focus-Color-and-or-Size/m-p/279466