Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3390944
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:44:57+00:00 2026-05-18T03:44:57+00:00

In Window Forms, I’ve put a pictureBox as a background image. Then, I’ve made

  • 0

In Window Forms, I’ve put a pictureBox as a background image. Then, I’ve made it so that if I resize the window, the image stretches and gets bigger as I resize it, and that the entire picture is always filling the entire form. For this, I’ve used the following code:

     image.Dock = DockStyle.Fill;
     image.Anchor = AnchorStyles.Top | AnchorStyles.Left;
     image.SizeMode = PictureBoxSizeMode.StretchImage;

I had no problems with that whatsoever simply because the image is filling in the entire window.

What I want to do now, however, is to put on another (smaller) pictureBox, that’s going to be exactly 20 px above the center of the Form, and will also stretch appropriately as I resize the window, and will always stay slightly above the center of the Form, no matter how much I resize it.

The thing is that I cannot set the Location property of the pictureBox, because then the position is absolute and the image will not stretch and stay in the center as I resize the window, but will remain where it is, according to the x and y coordinates of the window. What I want is for the picture to stretch and move according to how I stretch and move the window, just like I’ve managed to do with the image I have in background.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:44:58+00:00Added an answer on May 18, 2026 at 3:44 am

    Position your imagebox on the form where you want it, then set the Anchor proprety to top, bottom, right, and left. By pinning it to all four sides, it will stretch and shrink as the form resizes.

    Use these in conjunction with the MinimumSize and MaximumSize properties to keep the image from getting too small or too large.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.