如何让PictureBox透明化。
我的工作:
我已经将PictureBox BackColour设置为透明,但我仍然看不到DataGridView也是状态标签旁边的TextBox。
有人可以帮我实现这样的目标。
我想要实现:
提前致谢:)
答案 0 :(得分:1)
将背景颜色设置为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