- This topic explains about how to place form in lower right corner of the screen in C# programming.
- Here you can position form on corner of your screen using C# programming.
SystemInformation Class – Place form in lower right corner of the screen in C#
- SystemInformation Class provides information about the current system environment.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
- Syntax for SystemInformation Class
|
1 2 3 |
// Declaration public class SystemInformation { } |
SystemInformation.WorkingArea Property – Place form in lower right corner of the screen in C#
- SystemInformation.WorkingArea Property gets the size, in pixels, of the working area of the screen.
Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
- Syntax for SystemInformation.WorkingArea
|
1 2 3 |
// Declaration public static Rectangle WorkingArea { } |
Rectangle Structure – Place form in lower right corner of the screen in C#
- Rectangle Structure stores a set of four integers that represent the location and size of a rectangle.
Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
- Syntax for Rectangle Structure
|
1 2 3 4 5 6 |
// Declaration [SerializableAttribute()] [TypeConverterAttribute(typeof(RectangleConverter))] [ComVisibleAttribute(true)] public struct Rectangle { } |
Rectangle.Left Property – Place form in lower right corner of the screen in C#
- Rectangle.Left Property gets the x-coordinate of the left edge of this Rectangle structure.
- Syntax for Rectangle.Left property
|
1 2 3 |
'Declaration <BrowsableAttribute(False)> _ Public ReadOnly Property Left As Integer |
Rectangle.Top Property – Place form in lower right corner of the screen in C#
- Rectangle.Top Property gets the y-coordinate of the top edge of this Rectangle structure.
Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Rectangle.Width Property – Place form in lower right corner of the screen in C#
- Rectangle.Width Property gets or sets the width of this Rectangle structure.
Rectangle.Height Property – Place form in lower right corner of the screen in C#
- Help to set the height of the rectangle structure.
Place form in lower right corner of the screen in C# – Complete Code
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Rectangle Frame_area = SystemInformation.WorkingArea; int x = (Frame_area.Left + (Frame_area.Width - this.Width)); int y = (Frame_area.Top + (Frame_area.Height - this.Height)); this.Location = new Point(x, y); } } } |
Place form in lower right corner of the screen in C#






