-4

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;

1 Answers1

1

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.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
BCA
  • 438
  • 6
  • 21
  • Thanks for your answer but sir am new user i don't know how can do anchoring can you please explain me about it – Muhammad Sajid Lakha Jul 25 '16 at 15:04
  • Sir is it possible if my client screen resolution is 1920*1080 like my screen resolution so my application fit perfect – Muhammad Sajid Lakha Jul 25 '16 at 19:40
  • Most of the form objects have anchor propertiy , you can see that option ,Select form object , right click properties , at top you can sort which properties that object has then find Anchor. find detail info about Anchor in visual studio , google. And if you set your forms Maximum and minimum size (these are form properties) to 1920 * 1080(max) , set something to min for example (1920 * 1080) and start to design form application then it is ok. But its only adjusted 1920 * 1080 not for lower and higher resulotions. – BCA Jul 26 '16 at 10:31