答案 0 :(得分:0)
我给你一些想法: 您可以将窗体的BackColor和TransparencyKey Color属性设置为相同的颜色。 然后通过以这种方式处理Mybase.Paint事件来指定所需的透明图像:
Private Sub frmLogin_Paint(ByVal sender As Object,
ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
If Not Me.cObjImagen Is Nothing Then
e.Graphics.DrawImage(Me.cObjImagen, 0, 0, Me.Width, Me.Height)
End If
End Sub
在哪里' cObjImagen'是一个system.drawing.Image从' form_load'事件,或来自' public sub new()',例如......
如果您需要移动表单,这将有助于您正确处理邮件:
Private Const WM_NCHITTEST As Integer = 132
Private Const HTCAPTION As Integer = 2
Protected Overloads Overrides Sub WndProc(ByRef m As Message)
If m.Msg = WM_NCHITTEST Then
m.Result = New IntPtr(HTCAPTION)
Else
MyBase.WndProc(m)
End If
End Sub