有关窗体透明问题
发表在VB答疑区
2012-11-23
是否精华
是
否
版块置顶:
是
否
《Visual Basic开发实战1200例》(第Ⅰ卷)(配光盘)中代码如下:
'设置窗体透明:
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Sub Form_Load()
Dim Bitmap '设置窗体透明
Me.AutoRedraw = True
Bitmap = CreateCompatibleBitmap(Me.hdc, 0, 0)
SelectObject Me.hdc, Bitmap
end if
把label控件背景属性设为0-transparent,但运行程序后发现label控件背景色为白色,并非完全透明,请问这怎样改才能使label控件没有背景色?
'设置窗体透明:
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Sub Form_Load()
Dim Bitmap '设置窗体透明
Me.AutoRedraw = True
Bitmap = CreateCompatibleBitmap(Me.hdc, 0, 0)
SelectObject Me.hdc, Bitmap
end if
把label控件背景属性设为0-transparent,但运行程序后发现label控件背景色为白色,并非完全透明,请问这怎样改才能使label控件没有背景色?