窗体问题,高手帮忙看一下
以下代码是我照着书上编的,但是运行后没有显示出应该的效果,应该显示一个字体窗口 VB6 ,可是没有显示出来,高手帮忙看一下,那里有问题,代码如下Private Declare Function BeginPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function PathToRegion Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function CreateFont Lib "gdi32" Alias "CreateFontA" (ByVal H As Long, ByVal W As Long, ByVal E As Long, ByVal O As Long, ByVal W As Long, ByVal I As Long, ByVal u As Long, ByVal S As Long, ByVal C As Long, ByVal OP As Long, ByVal CP As Long, ByVal Q As Long, ByVal PAF As Long, ByVal F As String) As Long
Private Const OPAQUE = 2
Private Const TRANSPARENT = 1
Private Const ANSI_CHARSET = 0
Private Const FW_HEAVY = 900
Private Const OUT_DEFAULT_PRECIS = 0
Private Const CLIP_DEFAULT_PRECIS = 0
Private Const DEFAULT_QUALITY = 0
Private Const DEFAULT_PITCH = 0
Private Const FF_SWISS = 32
Private Sub Form_Load()
Dim dc As Long
Dim m_wndRgn As Long
Dim m_Font As Long
Dim m_OldFont As Long
dc = Me.hdc
m_Font = CreateFont(200, 90, 0, 0, FW_HEAVY, 1, 0, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH Or FF_SWISS, "ËÎÌå")
BeginPath dc
SetBkMode dc, TRANSPARENT
m_OldFont = SelectObject(dc, m_Font)
TextOut dc, 0, 0, "VB6", 3
SelectObject dc, m_OldFont
EndPath dc
m_wndRgn = PathToRegion(dc)
SetWindowRgn Me.hWnd, m_w_wndrgn, True
End Sub