System.Windows.Forms.DomainUpDown Class

Represents a Windows spin box (also known as an up-down control) that displays string values.

See Also: DomainUpDown Members

Syntax

[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.ComponentModel.DefaultBindingProperty("SelectedItem")]
[System.ComponentModel.DefaultEvent("SelectedItemChanged")]
[System.ComponentModel.DefaultProperty("Items")]
public class DomainUpDown : UpDownBase

Remarks

A System.Windows.Forms.DomainUpDown control displays a single string value that is selected from an object collection by clicking the up or down buttons of the control. The user can also enter text in the control, unless the UpDownBase.ReadOnly property is set to true (the string typed in must match an item in the collection to be accepted). When an item is selected, the object is converted to a string value so it can be displayed in the spin box.

To create a collection of objects to display in the System.Windows.Forms.DomainUpDown control, you can add or remove the items individually by using the ArrayList.Add(object) and ArrayList.Remove(object) methods. This can be called in an event handler, such as the Control.Click event of a button. The object collection can be sorted alphabetically by setting the DomainUpDown.Sorted property to true. When the DomainUpDown.Wrap property is set to true, if you scroll past the last or first object in the collection, the list will start over with the first or last object respectively and appear to roll in a continuous list.

When the DomainUpDown.UpButton or DomainUpDown.DownButton methods are called, either in code or by the click of the up or down buttons, DomainUpDown.UpdateEditText is called to update the control with the new string. If UpDownBase.UserEdit is set to true, the string is matched to one of the values in the collection prior to updating the control's text display.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0