Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

c#

Is there a standard c# class that defines a notional Left, Right, Top and Bottom?

Should I just use my own?

enum controlAlignment
{
    left = 1,
    top,
    right,
    bottom,
    none = 0
}
like image 734
TK. Avatar asked Feb 10 '09 08:02

TK.


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is the full name of C?

In the real sense it has no meaning or full form. It was developed by Dennis Ritchie and Ken Thompson at AT&T bell Lab. First, they used to call it as B language then later they made some improvement into it and renamed it as C and its superscript as C++ which was invented by Dr.

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.

What is C language?

C is an imperative procedural language supporting structured programming, lexical variable scope, and recursion, with a static type system. It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support.


2 Answers

For WPF projects (rather than WinForms) there's System.Windows.Controls.Dock. It has nothing but Left, Top, Right and Bottom.

like image 77
Keith Stein Avatar answered Oct 05 '22 00:10

Keith Stein


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
like image 23
Cerebrus Avatar answered Oct 05 '22 01:10

Cerebrus