Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

An Extended ListBox Control

0.00/5 (No votes)
17 Dec 2002 1  
A control that offers extensible entry specification and full keyboard support

Sample Image - ListBoxEx.jpg

Introduction

This control is a .NET version of the extended ListBox editor that originally showed up in Visual Studio. The control offers an extensible interface for specifying ordered entries of data items in string format. The control uses a button at the end of each line in the list, to allow the user a custom interface for specifying the text for that entry.

In addition to the GUI, the control offers full keyboard support for specifying entries in the list.

INSERT Creates a new item at the end of the list
DELETE Deletes the currently selected item
CTRL+UP ARROW Moves the selected item up in the list
CTRL+DOWN ARROW Moves the selected item down in the list
ENTER Calls to the IBrowser interface to allow the user to specify a value

The namespace defines an interface IBrowser that allows a programmer to extensibly specify how to obtain the value for the selected entry. With this interface, a programmer could specify any type of interface for configuration data. As long as the data can be represented as a string, the configuration data can be ordered by this control.

public interface IBrowser
{
    string Value
    {
        get;
        set;
    }
}

The control comes with a simple IBrowser implementation called OpenFileBrowser. This implementation simply creates the OpenFileDialog object and allows the user to specify a particular file. The genesis for the control was to have a base control to use, for specifying lists of IP Address specifications/ranges.

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below. A list of licenses authors might use can be found here.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here