Dogus Sunna
Dogus Sunna

Reputation: 91

Show C# WinForm on different screens

On my workstation I have developed a WinForm application. With panels, buttons and dropdowns.

After that I applied the application to my laptop.

On my laptop the presentation of the application was not correct. The elements overlap and the buttons are warped.

Can you tell me how to handle this?

I apologize for my english. This text was written with Google translator.

Upvotes: 1

Views: 234

Answers (4)

Saurabh
Saurabh

Reputation: 1631

1.] Either use Anchor or Dock
2.] Or try to fix the minimum and maximum size of your form and disable maximize button

Upvotes: 0

l33t
l33t

Reputation: 19996

Make sure to develop your forms on a computer with the system DPI setting set to 100%. Visual Studio will automatically convert your form coordinates depending on this system setting (it's a bug according to me). A quick way to fix a form is to do the following:

  1. Make sure the system DPI setting is set to 100%.
  2. Move a button in the form one pixel to the left. Then move it back again.
  3. Save. Compile. Run.

Upvotes: 0

Chrille
Chrille

Reputation: 1453

I've seen this behavior running Windows with a "display size" setting greater than 100%. Try resetting this value in your display settings:

display size

Upvotes: 2

Codor
Codor

Reputation: 17605

It is a bit difficult to tell from the distance, but I guess the window uses a different size on the laptop and the controls' docking and anchoring are not configured to do what you want. I suggest this and this tutorial on how to configure the properties; this is preferrably done in the designer instead of code for a fixed layout.

Upvotes: 2

Related Questions