我怎样才能使PictureBox透明。
我的工作:
我已经将PictureBox BackColour设置为透明,但仍然看不到状态标签旁边的DataGridView和TextBox。
有人能帮我实现这样的目标吗?
我想要:
(预先谢谢:)
发布于 2016-09-01 08:24:32
将背景颜色设置为Transparent
可能会导致误解。你看到的白色是形式背景。
如果不在窗体的Paint
事件中自己绘制图片,就无法使控件透明
编辑:
假设您有一个要在其上绘制图像的DataGridView1
控件:
Private Sub DataGridView1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles DataGridView1.Paint
' Create image.
Dim newImage As Image = Image.FromFile("pic.png")
' Adjust this as you need
Dim x As Single = 100
Dim y As Single = 50
Dim width As Single = 100
Dim height As Single = 100
' Draw image on top of the control
e.Graphics.DrawImage(newImage, x, y, width, height)
End Sub
https://stackoverflow.com/questions/39266012
复制相似问题