View Full Version : سوال: جابه جایی فرم border style=0
vb-sosol
یک شنبه 28 اسفند 1390, 13:48 عصر
سلام دوستان
اگه فرمی داشته باشم که اجبارا از border style=0 استفاده کنم
بخوام جا به جا بشه روی دسکتاپ باید چه کار کنم؟
بهروز عباسی
یک شنبه 28 اسفند 1390, 14:17 عصر
بخوام جا به جا بشه روی دسکتاپ باید چه کار کنم؟ این کارو
'-=-=-=-=- API FormDrag -=-=-=-=-=-=
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 ReleaseCapture Lib "user32" () As Long
'-----------------------------
Public Sub FormDrag(ByVal hWnd As Long)
ReleaseCapture
Call SendMessage(hWnd, &HA1, 2, 0&)
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
FormDrag (Me.hWnd)
End Sub
setroyd
یک شنبه 28 اسفند 1390, 23:54 عصر
Dim xx, yy
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
xx = X
yy = Y
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Me.Left = Me.Left + (X - xx)
Me.Top = Me.Top + (Y - yy)
End If
End Sub
با این هم میشه ولی کد دوستمون که گذاشتن اصولی تر و بهتره کلا api رو من بیشتر میپسندم .
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.