Option Explicit
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Copyright ©1996-2011 VBnet/Randy Birch, All Rights Reserved.
' Some pages may also contain other copyrights by the author.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Distribution: You can freely use this code in your own
' applications, but you may not reproduce
' or publish this code on any web site,
' online service, or distribute as source
' on any media without express permission.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTBOTTOMRIGHT = 17
Private Sub Form_Load()
With Label1
.ForeColor = &H80000015
.BackStyle = vbTransparent
.AutoSize = True
.Font.Size = 12
.Font.Name = "Marlett"
.Caption = "o"
.Font.Bold = False
End With
End Sub
Private Sub Form_Resize()
Label1.Move Me.ScaleLeft + Me.ScaleWidth - (Label1.Width + 40), _
Me.ScaleTop + Me.ScaleHeight - (Label1.Height + 40)
End Sub
Private Sub Label1_MouseDown(Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)
If Button = vbLeftButton Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTBOTTOMRIGHT, 0
End If
End Sub
Private Sub Label1_MouseMove(Button As Integer, _
Shift As Integer, _
X As Single, _
Y As Single)
Label1.MousePointer = 8
End Sub |