C# 窗体的背景图像作为 pictureBox 父级?
我有一个具有一定透明度的图片框。我发现我可以使用 picturebox.Parent 设置父图像,但仅当 Parent 是另一个图片框时才有效。但是如果我希望表单的背景图像成为图片框的父图像怎么办?
pictureBox1.Parent = PictureBox2; //works fine (of course if there is a pbox2)
pictureBox1.Parent = Form1; //??? magic goes here
I have a picturebox with some transparency. I found out I can use picturebox.Parent to set the parent image, but it only works when Parent is another picturebox. But what if i want form's background image to be picturebox's parent?
pictureBox1.Parent = PictureBox2; //works fine (of course if there is a pbox2)
pictureBox1.Parent = Form1; //??? magic goes here
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我理解得好的话,你希望你的背景是透明的。如果是这样,请使用:
If I understood well, you want that your background would be transparent. If so, use:
您是否尝试使用透明图像作为表单的背景?如果是这样,你就不能这样做,你必须使用透明键。
您上面尝试做的事情是这样的,但我不知道这会实现什么......
Are you trying to use an image with transparency as the background to your form? If so, you can't do that you have to use a transparency key.
what you are trying to do above works this way but I don't know what that would accomplish...