3

我有一个PictureBox停靠在表单左上角的。它包含在 aSplitContainer中,并且PictureBox设置为填充它所在的面板的一侧:

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

我将SizeMode设置设置为缩放,以便调整图像大小以适应PictureBox. 默认情况下,图像以 this 为中心SizeMode。我想知道是否可以强制图像左对齐而不是居中。

提前致谢!

4

1 回答 1

0

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.

于 2009-04-16T14:07:35.293 回答