New control being added to upcoming DotNetBar for Windows Forms 7.9 is IP Address Input control. It allows you to enter the IP address value in structured manner and it also supports the null values so you can safely bind it to database fields.

That’s all nice and useful, but we wanted to add more goodness to it, so we introduced a new twist with the free-text value entry. Where the default input mode is structured field mode, you can also switch the control to the free text entry mode using the  button.

When free-text entry button is clicked the field inputs get replaced with the text-box input which accepts anything user types in. Why is this useful? Now you can accept values that are not in default structured format for the control. For example, we provide default implementation where the value entered is resolved as host or domain name into the IP address automatically.

So if you switch the control to free-text entry mode and type, that value will be converted into the IP address of our web site. This is how that looks like while input is in progress:

Once Enter key is pressed or control loses input focus the value is resolved to IP address. You can turn this off by setting AutoResolveFreeTextEntries property to false.

Usage of this feature is completely optional. ButtonFreeText property is there so you can hide/show free text button, change its image etc. Using FreeTextEntryMode property you can toggle the free-text entry mode from code. You can also set AutoOffFreeTextEntry property to false to turn-off free-text entry automatically when input field loses focus.

But, that is not all. We also provide a way for you to parse entered free-text values into the value control expects. You do so by handling the ConvertFreeTextEntry event. Here is sample code which converts the string “custom” to an IP address:

private void ipAddressInput1_ConvertFreeTextEntry(object sender, DevComponents.Editors.FreeTextEntryConversionEventArgs e)
    if (e.ValueEntered.ToLower()=="custom")
        e.IsValueConverted = true;

This input control supports all the stuff that our other input controls support, custom popups so you can drop-down any Windows Forms control, custom popup menu items, custom buttons, watermarking, focus highlighting and more.

Professional looking applications made easy with DotNetBar for WinForms, Silverlight and WPF User Interface components. Click here to find out more.