LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change string indicator background color when in focus

Solved!
Go to solution

Hi, I know how I can change the background color for a string indicator using property Text.BGColor.

My question is how can I change this only when the indicator is in Focus, I mean when the cursor is in that field.

As soon as the cursor goes to another string indicator I would like the color to follow the cursor so to say.

0 Kudos
Message 1 of 5
(3,991 Views)

Use an event structure with the Mouse Enter and Mouse Leave events. You could combine all the events in to one event case and use the Control Reference output for the event to change the specific control's color.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 5
(3,986 Views)
Solution
Accepted by topic author hasse

1. Go give this idea a Kudos: Key focus Event

2. You could do something like this in a loop


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(3,974 Views)

That idea deserves Kudos indeed.

 

If your user will be tabbing between controls, OP will have to poll the focus just like crossrulz suggests.

If mouse events will be satisfactory, the best way to do this would be with an event structure, so your polling isn't using up processing power.

Color Me Sherbet.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 5
(3,966 Views)

Thanks, that works exactly as I wanted. Thanks also James for your input.

0 Kudos
Message 5 of 5
(3,942 Views)