Squirm
03-16-2004, 10:18 AM
You've seen it in Control Panel, now see it in your own apps! The Windows Common Controls includes a control called the IPADDRESS control. No prizes for guessing what it is for. However, the Common Controls Set OCX which comes with VB does not include it! A travesty, considering how easy it is to use.
This very simple control wraps all the required functionality of this neat little window. Masked edit box eat your heart out, baby! Plonk one of these onto your form and then use the IPAddressAsLong and IPAddressAsString properties to work with the data. Note that the IPAddressAsLong version returns/sets an IP address in host byte order. Therefore you'll need to run the returned value through htonl before you pass it to any wsock32 functions.
Any questions, comments, flames to be directed at me via PM. Have fun now...
This very simple control wraps all the required functionality of this neat little window. Masked edit box eat your heart out, baby! Plonk one of these onto your form and then use the IPAddressAsLong and IPAddressAsString properties to work with the data. Note that the IPAddressAsLong version returns/sets an IP address in host byte order. Therefore you'll need to run the returned value through htonl before you pass it to any wsock32 functions.
Any questions, comments, flames to be directed at me via PM. Have fun now...