Hej finns det något alternativ till denna kod. Den funkar perfekt i Win98, Me men inte i 2000 och XP.. Testa Istället:Flytta Form utan border....
"Den är till för att flytta en form som inte har någon border" men det visste ni väll redan ;o)
'Modul1
Public Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lparam As Any) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Const WM_SYSCOMMAND = &H112
Public Const MOUSE_MOVE = &HF012
'Form
Private Sub FlyttaForm1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim lReturn As Long
Call ReleaseCapture
lReturn = SendMessage(Me.hwnd, WM_SYSCOMMAND, MOUSE_MOVE, 0)
End Sub
/WolfSv: Flytta Form utan border....
<code>
Private Const HTCAPTION As Long = 2&
Private Const WM_NCLBUTTONDOWN As Long = &HA1&
Private Declare Sub ReleaseCapture Lib "User32" ()
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 Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
ReleaseCapture
SendMessage Me.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
End If
End Sub
</code>