Merhaba arkdaşlar,
Başlıksız bir userform'um var. Herhangi bir yerinden tutarak sürükleyebilir miyim? Yardımcı olursanız çok sevinirim.
-
- Destek
-
Özel Arama
![]() |
Option Explicit
Option Base 0
Dim hWndForm As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) 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 Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Const RGN_DIFF = 4
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Private Declare Function ReleaseCapture Lib "user32" () As Long
Dim hWnd As Long
Sub DragForm(Frm As UserForm)
On Local Error Resume Next
Call ReleaseCapture
Call SendMessage(hWndForm, WM_NCLBUTTONDOWN, HTCAPTION, 0)
End Sub
Private Sub UserForm_Initialize()
On Error Resume Next
hWndForm = FindWindow("ThunderDFrame", Me.Caption)
End Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 Then
Call DragForm(Me)
End If
End Sub
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 1 misafir