Click here to Skip to main content
14,971,553 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Thanks in advance....I am designing a login page in Winforms after click login the screen gets full screen mode but the background image gets half of the screen not shown as full screen. I need the background image also shown in full screen mode. Pls guide...

What I have tried:

FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
WindowState = FormWindowState.Maximized;

Picturebox dock property to fill..
Updated 5-Feb-21 1:23am
Maciej Los 5-Feb-21 6:13am
And the problem is...
Member 15028582 5-Feb-21 6:21am
Screen gets fullsize but the I set the picturebox in that screen only....the image is not get full sized.....I need the image to full size

1 solution

If you've already set the PictureBox's dock property to Fill, then the PictureBox is filling the available space on the form.

The most likely issue is that the picture displayed within the PictureBox is not stretching to fill the whole PictureBox.

Set the PictureBox's SizeMode property[^] to an appropriate value - eg: either StretchImage or Zoom, depending on whether or not you want to keep the original aspect ratio of the image.
Maciej Los 5-Feb-21 14:10pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900