0

I am making a windows forms CLR application on Windows 10 and Visual Studio 2017 Community Edition. However, I am having problems rendering the picture properly when it is running.

Here is the png file (274x184 png file) I want to show as a label in the Window: lora pncg

I add the label to the window in the designer window, but it doesn't appear at all like it's supposed to:

designerWindow

Actual Window: actualWindow

Here are the label properties (I set AutoSize to False and it doesn't change anything): label properties

Is there something I am missing here? Is there a label setting that is wrong?

Alex C
  • 217
  • 2
  • 11
  • 1
    The image scales correctly to match the DPI of your monitor, but your UI design does not. https://stackoverflow.com/a/13228495/17034 – Hans Passant Dec 15 '17 at 23:11

1 Answers1

0

Remove the MaximumSize restriction. Set it to 0,0. As far as that goes, I would remove the MinimumSize restriction as well. Also, if you want the image to stay centered, then I would remove the anchors so that it isn't anchored at all, and because the image is resizing on you, you may need to recenter it programmatically when the form loads. Also, the AutoSize was not working because you set the MinimumSize and MaximumSize properties to the same value - the control could not resize. Turn AutoSize back to true.

David Fletcher
  • 305
  • 1
  • 7