Welcome, Guest  :: Login 

EntrySet.Lists Namespace

DropDownControl Component

The PureComponents DropDownControl is a component designed to show any control as a drop down list. The control then appears in two parts: the top part is a text box that allows the user to type a list item. This part contains a dropdown button for opening the second part. The second part is your control that displays a list of items from which the user can select one. In fact, your control doesn't really need to be a list. The DropDownControl can simply be used anytime when there's a short form to show in the small rectangle and a larger amount of information (or list) to be shown as a popup window.

The popup window has a header at the top which can be turned on and off with the ShowHeader property. The ShowStatus property shows and hides the status bar at the bottom. The text is accessible through HeaderText and StatusText properties. By setting the AllowListResize property to true you can allow the user to resize the popup window.

The usage of a DropDownControl is very straightforward - you just create new class derived from the DropDownControl, override the OnPopupShowing method and provide your control there. This control needs to implement the simple IDropDownControl interface, which gives an information what to show in the textbox and when to close the popup. You can of course create additional properties and metods to change your control appearance etc.

You can also change the way the item is painted within the textbox part - you just override the OnPaintBackground and OnPaintForeground methods.