LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric Control: disable textbox entry in order to use in/decrement buttons only?

Hello there,
 
Is there a way to disable editing of the textbox in a numeric control so that the user can only see the value when he uses the in/decrement buttons?
 
I know this could be achieved by using an numeric indicator and two buttons in a while loop. However I run into problems when I use this approach together with my event loop. Therefore I thought there might be an easier way by doing it directly with a numeric control. Is this possible? Thanks for your help.
0 Kudos
Message 1 of 3
(3,265 Views)

Some elements in your question make me think you are programming in LabVIEW: if this is true, you should repost this question in the appropriate forum.

If I'm wrong and your develpment environment is CVI you could attach a callback to the control and swallow (i.e. return 1) the keyboard events:

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



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,260 Views)
Yes sorry you are totally right. I put this in the wrong forum. I will be more careful next time.
0 Kudos
Message 3 of 3
(3,232 Views)