Edit Enumerators Dialog Box

Click the Edit Enumerators button in the Types view to launch the Edit Enumerators dialog box, in which you can add, edit, or remove the enumerators of an enum type.

You can perform the following tasks in the Edit Enumerators dialog box:

  • To make the enumeration a flags type, enable the Flags Enumeration option.
  • To make the enumeration a strict type, enable the Strict Enumeration option.
  • To add new enumerators, click on the last row in the table and begin typing.
  • To edit existing enumerators, click on the corresponding cell in the table and make changes.
  • To remove enumerators, click on the delete button to the right of the Value field in the row of the enumerator you want to remove.

No changes are committed until you press OK . Pressing Cancel reverts all changes.

Enumerator Names and Values

Enumerator names must be unique. You can use any string for non-flags enumerator names, but flags enumerator names are restricted to valid identifiers.

Enumerator values must be numbers that fit the representation of the enum type. Hexadecimal, octal, and binary values are accepted, but will be converted according to the numeric format of the enum type.

If the enum type had no enumerators, then adding new enumerators will set the default value to the first enumerator. If the default value was previously set to an enumerator and the value of that enumerator changed, the default value will be updated accordingly. If that enumerator was deleted, the default value will be set to the first enumerator. If all enumerators are deleted, the enum type will enter into an invalid state.