views:

560

answers:

1

I have a PictureBox that is docked in the upper left corner of a form. It is contained inside of a SplitContainer, and the PictureBox is set to Fill the side of the panel that it resides:

  SplitContainer:
 ___________________
|  _________        >   
| |         |       >
| | LogoBox |       >
| |_________|       >
|___________________>

I have the SizeMode set to Zoom so that the image will be resized to fit the bounds of the PictureBox. By default, the image is centered with this SizeMode. I am wondering if it is possible to force the image to be left-aligned instead of centered.

Thanks in advance!

A: 

It seems to me that Zoom is always going to align the left and right sides with its container. I would suggest trying one of these workarounds:

  1. Create another panel within the left panel of your existing SplitContainer. The new one would be transparent an essentially used as a spacer. As long as this is at the lowest z-level (sent to back) this should not interfere with your other controls.

  2. Add a percentage of transparent pixels to the right of your image in your image editor relative to how much spacing you need after the zoom is done. In this case you would need to make sure you have the correct image format.

Tom Willwerth