Thursday, 9 August 2018

Centralize the Panel in Windows Application

There comes a scenario when you want to centralize the panel in Maximized Window State according to client's Screen Width and Height.

In the form Load Event:

private void frm_Load(object sender, EventArgs e)
{
     Panel1.Location = new Point(
     this.ClientSize.Width / 2 - Panel1.Size.Width / 2,
     this.ClientSize.Height / 2 - Panel1.Size.Height / 2);
}

Happy Coding

No comments:

Post a Comment

SQL Audits

1. sys.server_audits What it is: Lists all server-level audit objects . An audit is the top-level object that defines: Where to wri...