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 devcomponents.com, 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.ControlValue="255.255.1.1";
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.
Hi Denis,
wow, cool feature! I think, that’s pretty useful… I’m really looking forward to 7.9, also because of Ctrl+C-Support for MessageBoxEx. Do you already know when 7.9 will be released?
Best regards
Ben
Thank you Ben. I expect 7.9 to drop hopefully sometime next week.
[…] mentioned in my previous post on new IP Address Input control that it supports free-text entry. We have also added free-text […]