get number of element enum c# code example Example: c# get amount of elements in enum int count = Enum.GetValues( typeof( ContentAlignment ) ).Length;