برای لیبل به دلیل نداشتن هندل سخت تر هست... شما می تونید به جای لیبل از Picture1 استفاده کنید:
PictureResize.png
Option Explicit
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 HTCAPTION = 2
Private Const HTBOTTOMRIGHT = 17
Private Const HTBOTTOM = 15
Private Const HTBOTTOMLEFT = 16
Private Const HTLEFT = 10
Private Const HTRIGHT = 11
Private Const HTTOP = 12
Private Const HTTOPLEFT = 13
Private Const HTTOPRIGHT = 14
Private Const Margin = 200
Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture1.Print "Barnamenevis.org"
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
With Picture1
.MousePointer = 0
If X > .Width - Margin * 1.5 And Y < Margin * 1.5 Then
.MousePointer = 6
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTTOPRIGHT, 0&
End If
Exit Sub
End If
If X < Margin * 1.5 And Y < Margin * 1.5 Then
.MousePointer = 8
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTTOPLEFT, 0&
End If
Exit Sub
End If
If X > .Width - Margin * 1.5 And Y > .Height - Margin * 1.5 Then
.MousePointer = 8
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTBOTTOMRIGHT, 0&
End If
Exit Sub
End If
If X < Margin * 1.5 And Y > .Height - Margin * 1.5 Then
.MousePointer = 6
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTBOTTOMLEFT, 0&
End If
Exit Sub
End If
If X > .Width - Margin And Y < .Height - Margin Then
.MousePointer = 9
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTRIGHT, 0&
End If
Exit Sub
End If
If X < Margin And Y > Margin Then
.MousePointer = 9
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTLEFT, 0&
End If
Exit Sub
End If
If X < .Width - Margin And Y < Margin Then
.MousePointer = 7
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTTOP, 0&
End If
Exit Sub
End If
If X < .Width - Margin And Y > .Height - Margin Then
.MousePointer = 7
If Button = 1 Then
ReleaseCapture
SendMessage .hwnd, WM_NCLBUTTONDOWN, HTBOTTOM, 0&
End If
Exit Sub
End If
End With
End Sub