Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Knowledge Base > Code Library > IP Address Control

Thread Tools Display Modes
Old 03-16-2004, 11:18 AM
Squirm's Avatar
Squirm Squirm is offline
Political Coder

Retired Moderator
* Guru *
Join Date: Mar 2001
Location: London, England
Posts: 8,037
Default IP Address Control

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...
Attached Images
File Type: gif IPAddress.GIF (4.4 KB, 742 views)
Attached Files
File Type: zip IPAddress.zip (1.9 KB, 1078 views)
Search the forums | Use [vb][/vb] tags | Still IRCing

Last edited by Squirm; 03-16-2004 at 11:25 AM.
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MsFlexGrid & VBA msl Word, PowerPoint, Outlook, and Other Office Products 2 09-17-2006 03:21 PM
Add Control in Form at Runtime - No Control Array Purdue2379 General 10 03-28-2003 05:23 PM
Control Arrays rpk2006 General 2 09-09-2002 12:06 PM
Why you can't put an Image/Label/Shape control in front of another control BillSoo Tutors' Corner 0 08-20-2002 01:20 PM
ActiveX Control WHM General 2 08-19-2001 12:57 PM


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..