using Sendmessage on user control ....
i have one active-x control made by me it just have a frame and command button .. i wanted to move my control like window to any where on form ... i did it my Send message passing using control's hwnd with WM_NCLBUTTONDOWN window message in control coding .. its working fine but now if i want to move it from code in outer form i.e. i move it by proeprties like top,left etc. through my code it doesnt move.It changes it pos once only but not after that ... i m not able to changes its position in run time through coding ... API usage on frame's mouse move is liek this ....
Private Sub frmCaption_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lngReturnValue As Long
'// Detect the left mouse button
If Button = 1 Then
'// Release the capture of the mouse
Call ReleaseCapture
'// Move the form with the mouse
lngReturnValue = SendMessage(UserControl.hwnd, WM_NCLBUTTONDOWN, _
HTCAPTION, 0&)
End If
End Sub
frame is some thing on which putting mouse i move/drag the control ...
i think use of this API stuck the movement of control when i use it in some form when i say usercontrol1.top = somehting etc. any one can help ??