0

I am actually working with PictureBox on .NET, then I face the problem below:

  • I create a PictureBox of size 370 x 370 with mode size "Normal"
  • I have a picture .png of size 370 x 370 (pixel)
  • Then I create a button to import the picture to the picturebox via OpenFileDialog
  • I run the app, then I click the button and I choose my picture

! Problem: My picture is not fit to my picturebox. Why ?

link to the screenshot

  • 2
    That picturebox is not 370x370. And there is a probable mismatch in the dots-per-inch between the image and the form. Set the PictureBox.SizeMode property and [read this](https://stackoverflow.com/a/13228495/17034). – Hans Passant May 05 '20 at 12:57
  • The SizeMode looks like Tiled. Note that you should have set the ClientSize to allow for a border not the (outer) Size. – TaW May 05 '20 at 13:23
  • @HansPassant: I added the file "Application Manifest File" to my project and uncommented dpiAware then it worked !!! Thanks – Van Minh Nhon TRUONG May 05 '20 at 13:28

0 Answers0