LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Change mouse cursor when over a control

Hello,
 
I have a numeric control, but I do not want the user to enter a value, so I set the ATTR_NO_EDIT_TEXT attribut to 1. When the user moves the mouse cursor over this numeric control, the cursor is automatically changed into an I-shaped cursor. Is there any way to prevent this? It seems that the ATTR_MOUSE_CURSOR attribute is only available for panels, not for controls Smiley Sad
 
Thanks,
Wim
0 Kudos
Message 1 of 3
(3,448 Views)
Even with the control mode to VAL_INDICATOR, the "typing" cursor also appears.  While that makes no sense from an input point of view, a person might want to select and copy the contents of the control.
 
Another thing to consider is whether you have a consistent and obvious color-coding scheme for controls in indicator mode vs those that are not. That alone can make it obvious to a user not to expect to be able to enter anything. Sometimes people make their own UI color schemes that bury the default distinction between control in indicator mode or not. 
 
If you are still determined, one possibility is "Extended Mouse Events" (Programmers Toolbox).  That should give you mouse coordinates that can be compared to the control's size and location, and you may then be able to override the cursor/pointer.   I've never tried this - perhaps someone can confirm or refute this as an option.
 
Hope this helps,
Ian
Message 2 of 3
(3,431 Views)

Hello Ian

Thanks for the quick reply.

Actually the value of the control can be changed, but it is changed programatically when the callback function receives a left click event.  That is why I use the ATTR_NO_EDIT_TEXT attribute instead of setting the control to VAL_INDICATOR.

I will try the Extended Mouse Events thing like you mentioned.

0 Kudos
Message 3 of 3
(3,419 Views)