C# standard class (enumeration?) for Top, Bottom, Left, Right

A quick search revealed that the following Framework Enumerations already have these members (some have other additional members) :

  • AnchorStyles - System.Windows.Forms
  • Border3DSide - System.Windows.Forms
  • DockStyle - System.Windows.Forms
  • Edges - System.Windows.Forms.VisualStyles
  • TabAlignment - System.Windows.Forms
  • ToolStripStatusLabelBorderSides - System.Windows.Forms
  • VerticalAlignment - System.Windows.Forms.VisualStyles

A nice enum might also be:

System.Drawing.ContentAlignment (in System.Drawing.dll)

These are its members:

public enum ContentAlignment
{
    TopLeft = 1,
    TopCenter = 2,
    TopRight = 4,
    MiddleLeft = 16,
    MiddleCenter = 32,
    MiddleRight = 64,
    BottomLeft = 256,
    BottomCenter = 512,
    BottomRight = 1024,
}

Perhaps System.Windows.Forms.AnchorStyles or System.Windows.Forms.DockStyles could do the job.

Tags:

C#