Scrolling a Form with ScrollBars causes background image to mess up

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bradyounie
    New Member
    • Aug 2008
    • 20

    Scrolling a Form with ScrollBars causes background image to mess up

    I'm trying to use a Form's BackgroundImage to display the base image that I'm placing controls on top of. To make the form scroll to the bounds of the image, I set the AutoScrollMinSi ze. This works great, except that when I scroll, the image gets all chopped up and doesn't automatically refresh when scrolling is done.

    Is there a way to prevent this problem so that it scrolls smoothly?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    PictureBox1.Ref resh();

    Comment

    • bradyounie
      New Member
      • Aug 2008
      • 20

      #3
      Originally posted by tlhintoq
      PictureBox1.Ref resh();
      Actually, I was displaying my image on the Form itself, and Refresh will only reset the image back to 0, 0, no matter how far over I've scrolled. In other words, I guess I can't use Form.Background Image if I want to be able to use the scroll bars to show parts of the image that are off the screen.

      So, now I'm using a PictureBox, which I had done before. The problem with that is that any controls that I place on top of the PictureBox that I want to be transparent won't be. This is because the transparent part of the control will see through the PictureBox and show what is on the Form itself. So, if you have a Form with a white background color with a PictureBox on top of it with Red Image and you place your transparent control on top of the PictureBox, the transaparent part of the control will show as white. I want it to show the image in the picture box, not the background of the Form.

      Does that make sense?

      Comment

      Working...