Search code examples
c#winformssizescreenresolution

How to fit C# application in every resolution


i want to know how to fit c# application in every Resolution my c# application open in my computer is perfect but when i install this application on my client machine so it's show half application.

What I have tried:

this.WindowState = FormWindowState.Maximized;
this.Location = new Point(0, 0);
this.Size = Screen.PrimaryScreen.WorkingArea.Size;

Solution

  • This won't work for all, you need to desing your application responsive. You need to use panels, groupboxes and objects like these and you need to anchor these objects inside your form, then you need to get user screen resolution and set it for your application.

    Summary: this code may works but not not perfect for all resolution. You absoluty need anchoring objects. Desktop application sometimes have good pain with this matter.