Format a Color enumeration value in (D) Decimal number : Console Format « Development « VB.Net





Format a Color enumeration value in (D) Decimal number

 

Imports System
Imports Microsoft.VisualBasic

Class Sample
   Public Enum Color
      Yellow = 1
      Blue = 2
      Green = 3
   End Enum 'Color
   Public Shared Sub Main()
      Console.Clear()

      Console.WriteLine("Standard Enumeration Format Specifiers")
      Console.WriteLine("(G) General:. . . . . . . . . {0:G}" & vbCrLf & _
                        "    (default):. . . . . . . . {0} (default = 'G')" & vbCrLf & _
                        "(F) Flags:. . . . . . . . . . {0:F} (flags or integer)" & vbCrLf & _
                        "(D) Decimal number: . . . . . {0:D}" & vbCrLf & _
                        "(X) Hexadecimal:. . . . . . . {0:X}" & vbCrLf, _
                        Color.Green)

   End Sub 'Main
End Class 'Sample

   
  










Related examples in the same category

1.Format a negative integer or floating-point number in Currency format
2.Format a negative integer or floating-point number in Decimal format
3.Format a negative integer or floating-point number in Scientific format
4.Format a negative integer or floating-point number in Fixed point format
5.Format a negative integer or floating-point number in General format
6.Format a negative integer or floating-point number in default format
7.Format a negative integer or floating-point number in Number format
8.Format a negative integer or floating-point number in Percent format
9.Format a negative integer or floating-point number in Round-trip format
10.Format a negative integer or floating-point number in Hexadecimal format
11.Format the current date in (d) Short date
12.Format the current date in (D) Long date
13.Format the current date in (t) Short time
14.Format the current date in (T) Long time
15.Format the current date in (f) Full date/short time
16.Format the current date in (F) Full date/long time
17.Format the current date in (g) General date/short time
18.Format the current date in (G) General date/long time
19.Format the current date in (M) Month
20.Format the current date in (R) RFC1123
21.Format the current date in (s) Sortable
22.Format the current date in (u) Universal sortable
23.Format the current date in (U) Universal full date/time
24.Format the current date in (Y) Year
25.Format a Color enumeration value in (G) General
26.Format a Color enumeration value in (default)
27.Format a Color enumeration value in (F) Flags
28.Format a Color enumeration value in (X) Hexadecimal