移动表格背景图片

Rowlandsfc

会员
已加入
2019年2月3日
留言内容
23
地点
布里真德
编程经验
Beginner
即时通讯创建一个游戏,我需要背景图像移到左侧,每次我单击键d时,它就可以与图片框一起使用,但是当我添加另一个图片框并将其设置为透明时,它将显示表格背景,而不是比第一个图片框图像要大的多,如果有可能要移动表格背景图像,请让我知道,或者确保将第二个图片框设置为透明时也能显示第二个图片框的内容。

谢谢
 

金西尼

C#论坛主持人
工作人员
已加入
2011年4月23日
留言内容
3,501
地点
悉尼,澳大利亚
编程经验
10+
Neither are possible. There are a few different layout options for the BackgroundImage but you cannot specify a location. As for transparent controls, Windows表格 doesn't support genuine transparency and just fakes it by having a child control effectively display its parent as its own background. The only way a PictureBox can show through another PictureBox is if one is the parent of the other. That is possible, although you have to do it in code, as you cannot add children to a PictureBox in the designer. It also means that the child cannot be displayed beyond the bounds of the parent. If that's a problem, you may be able to get around that by having another PictureBox that is not a child that occupies the same area on the screen as the child, so you can see a transparent one inside the other PictureBox and still see on in the right place outside too.
 
最佳 底部