[]
        
(Showing Draft Content)

SelectionMode

Enum Class SelectionMode

java.lang.Object
java.lang.Enum<SelectionMode>
com.grapecity.documents.excel.forms.SelectionMode
All Implemented Interfaces:
Serializable, Comparable<SelectionMode>, Constable

public enum SelectionMode extends Enum<SelectionMode>
Specifies how a list box allows item selection.

Use this enum with a list box control to determine whether users can select one item, multiple items without modifier keys, or multiple items by using the Ctrl key. The available modes correspond to the list box selection modes used by Excel VBA.


 IListBox listBox = worksheet.getControls().addListBox(24.1, 273.1, 170, 78.69);
 listBox.getItems().add(new ListBoxItem("Item 1"));
 listBox.getItems().add(new ListBoxItem("Item 2"));
 listBox.getItems().add(new ListBoxItem("Item 3"));
 listBox.setSelectionMode(SelectionMode.Extended);
 
  • Enum Constant Details

    • Single

      public static final SelectionMode Single
      Select single item in the list box (-4142 in Excel VBA).
    • Multiple

      public static final SelectionMode Multiple
      Select multiple items in the list box (-4154 in Excel VBA).
    • Extended

      public static final SelectionMode Extended
      Select multiple items with ctrl key in the list box (3 in Excel VBA).
  • Method Details

    • values

      public static SelectionMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SelectionMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getValue

      public int getValue()
    • forValue

      public static SelectionMode forValue(int value)