Partager via


ControlFormat.MultiSelect Property

Returns or sets the selection mode of the specified list box. Can be one of the following constants: xlNone, xlSimple, or xlExtended.

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Property MultiSelect As Integer
    Get
    Set
'Usage
Dim instance As ControlFormat
Dim value As Integer

value = instance.MultiSelect

instance.MultiSelect = value
int MultiSelect { get; set; }

Property Value

Type: System.Int32

Remarks

Single select (xlNone) allows only one item at a time to be selected. Clicking the mouse or pressing the SPACEBAR cancels the selection and selects the clicked item.

Simple multiselect (xlSimple) toggles the selection on an item in the list you click it with the mouse or press the SPACEBAR when the focus is on the item. This mode is appropriate for pick lists, in which there are often multiple items selected.

Extended multiselect (xlExtended) usually acts like a single-selection list box. When you click an item, you cancel all other selections. When you hold down SHIFT while clicking the mouse or pressing an arrow key, you select items sequentially from the current item. When you hold down CTRL while clicking the mouse, you add single items to the list. This mode is appropriate when multiple items are allowed but not often used.

You can use the Value or ListIndex property to return and set the selected item in a single-select list box.

You cannot link multiselect list boxes by using the LinkedCell property.

See Also

Reference

ControlFormat Interface

ControlFormat Members

Microsoft.Office.Interop.Excel Namespace