Visual C++ Enumerations in Class Designer

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Visual C++ Enumerations in Class Designer.

Class Designer supports C++ enum and scoped enum class types. Following is an example:

enum CardSuit {  
   Diamonds = 1,  
   Hearts = 2,  
   Clubs = 3,  
   Spades = 4  
};  
  
// or...  
enum class CardSuit {  
   Diamonds = 1,  
   Hearts = 2,  
   Clubs = 3,  
   Spades = 4  
};  
  

A C++ enumeration shape in a class diagram looks and works like a structure shape, except that the label reads Enum or Enum class, it is pink instead of blue, and it has a colored border on the left and top margins. Both enumeration shapes and structure shapes have square corners.

For more information about using the enum type, see Enumerations.

Working with Visual C++ Code (Class Designer)
Enumerations

Show: