Private Declare Function BeginPath 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 GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long Private Declare Function EndPath Lib "gdi32" (ByVal hdc As Long) As Long Dim p As Integer Private Sub Form_Click() p = p + 1 Dim mdc As Long, rgn As Long mdc = GetDC(Me.hwnd) 'MsgBox mdc, , Picture1.hdc SetBkMode Me.hdc, 0 BeginPath Me.hdc Me.CurrentY = 400 Me.CurrentX = 1 Me.Font.Size = 120 Me.Print p EndPath mdc rgn = PathToRegion(Me.hdc) SetWindowRgn Me.hwnd, rgn, True End Sub Private Sub Form_DblClick() End End Sub |