07-12-2018 04:40 PM
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
Solved! Go to Solution.
07-13-2018 01:48 AM - edited 07-13-2018 01:51 AM
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.