LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to differentiate between Mouse down events in string control (Click on contour vs click on center)?

Solved!
Go to solution

Hi,

 

I have a string control on my UI and I would like to differentiate between different mouse down events, i.e, to be able to differentiate a click on the contour or label of the controller vs a click on the center (control enters in "edit" mode)

 

The reason is that sometimes if the user does not click in the center but in the contour of the control, Labview fires the Mouse Down event but the keys typed are not registered...

 

Is there any way to distinguish both?

 

Thanks a lot for your help

 

 

0 Kudos
Message 1 of 5
(3,259 Views)
Solution
Accepted by topic author Dominigomes

Set the string control to "update while typing" and use a "value changed" event instead. Now the event fires whenever a new character is entered.

 

Message 2 of 5
(3,256 Views)

Didn't know that one!

 

Thank you very much altenbach! Smiley Wink

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

Actually, your soultion will do the job... but still.. is there any way to detect when the control is in "edit" mode? 

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

When you get the mouse down event you get coordinates of the mouse click. You also get the refernce to the control and for string control you can go to Text.Position (which give top and left coordinate of the text) and Text.Bounds (width, height). Do some math and you got the solution.

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