LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric Ctrl value not selectable?

Hi Happy CVI'ers,
I'm just looking after a little trick:
I display intruments values in numeric controls. Not editable, no
cursors, ... just display a value wich is refreshed every 30s.
However, the user can select the caracters inside the control. As the
background and text color change upon alarm state, I have some noisy
inverse colors with the selected part.
Is there any way to avoid selection in a not editable control (numeric
or text)

Thanks for any help,
--
Fred
0 Kudos
Message 1 of 2
(2,862 Views)
Sure, just swallow the left click event. See the CVI help for a discussion of swallowing events. Basically, you would just catch the left click event in a callback on the textbox or numeric and return a positive number. For example,

int CVICALLBACK TextCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_LEFT_CLICK:
return 1;
break;
}
return 0;
}

This will abort the normal processing of the left click, so the control will not get the focus and their can be no selecting.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,862 Views)