NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

ListBox Properties

The properties of the ListBox class are listed below. For a complete list of ListBox class members, see the ListBox Members topic.

Public:

AccessibilityObject (inherited from RichControl) The Accessibility Object for this RichControl
AccessibleDefaultActionDescription (inherited from RichControl) The default action description of the control
AccessibleDescription (inherited from RichControl) The accessible description of the control
AccessibleHelpProvider (inherited from RichControl) The help provider for this RichControl
AccessibleName (inherited from RichControl) The accessible name of the control
AccessibleRole (inherited from RichControl) The accessible role of the control
AllowDrop (inherited from RichControl) The allowDrop property. If allowDrop is set to true then this control will allow drag and drop operations and events to be used.
AllowTransparency (inherited from RichControl) Determines if the control should be allowed to have the opacity adjusted. This is primarily a performance optimization, in that you can always set the opacity to any value, and that will force AllowTransparency to true. However, setting the opacity to any given value will switch the control into layered mode. By setting the AllowTransparency property to false the control will actually switch out of layered mode, which provides better performance if you don't intend to adjust the opacity.
Anchor (inherited from RichControl) The current value of the anchor property. The anchor property determines which edges of the control are anchored to the container's edges.
BackColor (inherited from FormatControl) FormatControl overrides BackColor so it can return the current back color based on any kind of ambients the associated format object is providing.
BackgroundImage [To be supplied.]
BindingManager (inherited from RichControl) [To be supplied.]
Bindings (inherited from RichControl) Retrieves the bindings for this control.
BorderStyle Retrieves the current border style. Values for this are taken from The System.WinForms.BorderStyle enumeration.
Bottom (inherited from Control) The bottom coordinate of this control.
Bounds (inherited from Control) The bounds of this control. This is the window coordinates of the control in parent client coordinates.
CanFocus (inherited from Control) Checks if this control can receive focus. The result is true if the control has a handle and if it and all of its parent controls are both visible and enabled.
CanSelect (inherited from Control) Checks if this control can be selected. The result is true if the control is contained in a form and if all of its parent controls are both visible and enabled.
Capture (inherited from Control) If this control has captured the mouse then this will return true.
CausesValidation (inherited from Control) Indicates whether entering this control causes validation on the controls requiring validation. This is set to false usually for things like the Help button, etc...
ClientRectangle (inherited from Control) The client rect of the control.
ClientSize (inherited from Control) The size of the clientRect.
ColumnWidth If we're a multi-column listbox, then this returns the current width of each column in the List. A value of zero [0] means that windows will choose a default width for each column.
CompanyName (inherited from RichControl) Retrieves the company name of this specific component.
ContainsFocus (inherited from Control) Indicates whether the control or one of its children currently has the system focus.
ContextMenu (inherited from RichControl) The contextMenu associated with this control. The contextMenu will be shown when the user right clicks the mouse on the control.
Controls (inherited from Control) Collection of child controls.
Created (inherited from Control) Returns true if the control has been created.
Cursor (inherited from RichControl) Retrieves the cursor that will be displayed when the mouse is over this control.
DataSource (inherited from ListControl) The ListSource to consume as this ListBox's source of data. When set, a user can not modify the Items collection.
DisplayMember (inherited from ListControl) If the ListBox contains objects that support properties, this indicates which property of the object to show. If "", the object shows it's ToString().
DisplayRectangle (inherited from Control) Returns the client rect of the display area of the control. For the base control class, this is identical to getClientRect. However, inheriting controls may want to change this if their client area differs from their display area.
Disposed (inherited from Control) Indicates that the control has been disposed, and is no longer a valid Windows control even though the object instance is still alive.
Disposing (inherited from Control) Indicates that the control is in the process of being beendisposed, and is no longer a valid Windows control even though the object instance is still alive.
Dock (inherited from RichControl) The dock property. The dock property controls to which edge of the container this control is docked to. For example, when docked to the top of the container, the control will be displayed flush at the top of the container, extending the length of the container.
DrawMode Retrieves the style of the listbox. This will indicate if the system draws it, or if the user paints each item manually. It also indicates whether or not items have to be of the same height.
Enabled (inherited from Control) The current enabled state of this control.
Focused (inherited from Control) Returns true if this control has focus.
Font (inherited from FormatControl) FormatControl overrides Font so it can return the current font based on any kind of ambients the associated format object is providing.
ForeColor (inherited from FormatControl) FormatControl overrides ForeColor so it can return the current fore color based on any kind of ambients the associated format object is providing.
Format (inherited from FormatControl) The formatting object the control uses for Value<->Text conversion (with support for different conversions for display and edit mode) and for ForeColor/BackColor/Font enhancements. Format objects available include NumericFormat for numeric types, DateTimeFormat for DateTimes, and GenericFormat for value-to-text conversion based on TypeConverters.
Handle (inherited from Control) The HWND handle that this control is bound to. If the handle has not yet been created, this will force handle creation.
HandleCreated (inherited from Control) Whether or not this control has a handle associated with it.
Height (inherited from Control) The height of this control
IMEMode (inherited from RichControl) Specifies a value that determines the IME (Input Method Editor) status of the object when that object is selected.
IntegralHeight Indicates if the listbox should avoid showing partial Items. If so, then only full items will be displayed, and the listbox will be resized to prevent partial items from being shown. Otherwise, they will be shown
InvokeRequired (inherited from RichControl) Determines if the caller must call invoke when making method calls to this control. Controls in WinForms are bound to a specific thread, and are not thread safe. Therefore, if you are calling a control's method from a different thread, you must use the control's invoke method to marshal the call to the proper thread. This function can be used to determine if you must call invoke, which can be handy if you don't know what thread owns a control. There are five functions on a control that are safe to call from any thread: GetInvokeRequired, Invoke, BeginInvoke, EndInvoke and CreateGraphics. For all other metohd calls, you should use one of the invoke methods.
IsAccessible (inherited from RichControl) Indicates whether or not this control is an accessible control i.e. whether it should be visible to accessibility applications.
ItemHeight Returns the height of an item in an owner-draw list box. When drawMode is OwnerDrawFixed, all items have the same height. When drawMode is OwnerDrawVariable, this method returns the height that will be given to new items added to the list box. To determine the actual height of an item, use the getItemHeight() method with an integer parameter.
Items Collection of items in this listbox.
Left (inherited from Control) The left coordinate of this control.
Location (inherited from Control) The location of this control.
MultiColumn Indicates if the listbox is multi-column or not. If it's multi-column, then the listbox uses the columnWidth property to determine how wide to make each column, and displays the data horizontally in columns instead of vertically.
Opacity (inherited from RichControl) Determines the opacity of the control. This can only be set on top level controls. Opacity requires Windows 2000 or later, and is ignored on earlier operating systems.
Parent (inherited from Control) The parent of this control.
PreferredHeight The total height of the items in the list box.
ProductName (inherited from RichControl) Retrieves the product name of this specific component.
ProductVersion (inherited from RichControl) Retrieves the product version of this specific component.
RecreatingHandle (inherited from Control) This is true if the control is currently recreating its handle.
Region (inherited from RichControl) The Region associated with this control. (defines the outline/silhouette/boundary of control)
Right (inherited from Control) The right coordinate of this control.
RightToLeft (inherited from RichControl) This is used for international applications where the language is written from RightToLeft. When this property is true, control placement and text will be from right to left.
ScrollAlwaysVisible For normal listboxes, this indicates if the scroll bar will always be shown on the right side of the list, even if the number of list items is not enough to fill up the entire list. By Default, windows will only show a scrollbar when there are enough items to warrant it. For multi-column listboxes, Windows does not show a horizontal scroll bar at all. Setting this value indicates that a horizontal scroll bar should be added. There is never a vertical scroll bar.
SelectedIndex The index of the currently selected item in the list, if there is one. If the value is-1, there is currently no selection. If the value is 0 or greater, than the value is the index of the currently selected item. If the MultiSelect property on the ListBox is true, then a non-zero value for this property is the index of the first selection
SelectedIndices A collection of the indices of the selected items in the list box. If there are no selected items in the list box, the result is an empty collection.
SelectedItem The value of the currently selected item in the list, if there is one. If the value is null, there is currently no selection. If the value is non-null, then the value is that of the currently selected item. If the MultiSelect property on the ListBox is true, then a non-null return value for this method is the value of the first item selected
SelectedItems The collection of selected items.
SelectedValue (inherited from ListControl) [To be supplied.]
SelectionMode Controls how many items at a time can be selected in the listbox. Valid values are from the System.WinForms.SelectionMode enumeration.
Site (inherited from MarshalByRefComponent) Gets or sets the site of the component.
Size (inherited from Control) The size of this control.
Sorted Indicates if the ListBox is sorted or not. 'true' means that strings in the list will be sorted alphabetically
TabIndex (inherited from Control) The tab index of this control. A tab index may consist of any valid integer number greater than or equal to zero. If more than one control on the same parent control has the same tab index, the z-order of the controls will be used to determine the order to pick the controls.
TabStop (inherited from Control) A boolean value indicating whether the user can give the focus to this control using the TAB key.
Text [To be supplied.]
Top (inherited from Control) Top coordinate of this control.
TopIndex The index of the first visible item in a list box. Initially the item with index 0 is at the top of the list box, but if the list box contents have been scrolled another item may be at the top.
TopLevel (inherited from Control) true if this control is a top level window, meaning that it has no parent.
TopLevelControl (inherited from Control) The top level control that contains this control. This doesn't have to be the same as the value returned from getForm since forms can be parented to other controls.
UseTabStops Enables a list box to recognize and expand tab characters when drawing its strings.
Value [To be supplied.]
ValueMember (inherited from ListControl) [To be supplied.]
Visible (inherited from Control) Controls whether the control is visible.
Width (inherited from Control) The width of this control.
WindowTarget (inherited from Control) The target of Win32 window messages.

Protected:

CreateParams (inherited from ListControl) [To be supplied.]
CreateThreadId (inherited from Control) Retrieves the Win32 thread ID of the thread that created the handle for this control. If the control's handle hasn't been created yet, this method will return the current thread's ID.
FontHeight (inherited from RichControl) [To be supplied.]
InternalHandle (inherited from Control) Returns the current value of the handle. This may be zero if the handle has not been created.
ParkingFormHandle (inherited from RichControl) [To be supplied.]
RenderRightToLeft (inherited from RichControl) [To be supplied.]
RichParent (inherited from RichControl) [To be supplied.]
WindowText (inherited from Control) The current text of the Window; if the window has not yet been created, stores it in the control. If the window has been created, stores the text in the underlying win32 control. This property should be used whenever you want to get at the win32 control's text. For all other cases, use the Text property- but note that this is overridable, and any of your code that uses it will use the overridden version in controls that subclass your own.

See Also

ListBox Class | System.WinForms Namespace