LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

IP Control

Solved!
Go to solution

I see under Custom Controls->Toolslib Controls there is a 'IP Control'. And from what I read I thought it was suppose to validate that the ip address typed is in correct format but I don't know how it works.

I setup a control through .uir file and when I run my app and type anything it I don't understand how it's suppose to check it.

The help file is not much good.

 

Any suggestions?

 

Thanks

0 Kudos
Message 1 of 2
(2,079 Views)
Solution
Accepted by topic author atomic928

I don't seem to remember an example exists for the IP control, but its usage is rather simple: place a string control on the panel, call IPCtrl_ConvertFromString to create the IP control and that's all! In the rest of the program you can manipulate the control with regular SetCtrlVal / GetCtrlVal calls. All the functionality of validating user input is made internally by the instrument.

 

If you want to understand how it works internally, you can look at the instrument source code: basically a new callback is installed on the control that takes care of handling user input and discarding irregular characters.



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 2
(2,060 Views)