PDA

Click to See Complete Forum and Search --> : [repost] Show window content while dragging


Sibby
Feb 15th, 2002, 12:27 PM
(let's try the API guru forum)

I want to enulate the same thing you see when moving a form with the "Show window content while dragging" option turned on....but instead through code. Right now I'm using code based on an image with a MASK color for custom forms. So in that I'm using the RELEASECAPTURE & SENDMESSAGE API in the pictures MouseDown event to move the form. However, when I do that I get the window outline when moving. (looks bad).

So I tried the simple approach (see code below) and that yeilded a NASTY "trailing" effect on my image. (It's fun to mess the hell out of your screen :), but that's not really what the app is for)However when I go back to the original approach and turn on "Show window content while dragging" it looks spectacular! I just don't want the user to have to turn this on in order to get a good looking app. Windows can do it, I want to too... :rolleyes:

Any ideas?


Dim pX As Single, pY As Single

Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
pX = X
pY = Y
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Move Left - (pX - X), Top - (pY - Y)
End If
End Sub

Sibby
Feb 17th, 2002, 12:47 PM
*bump*

anyone? :)

Shawn N
Feb 18th, 2002, 12:09 PM
In your form's MouseMove you're going to do something like this...



If Button = 1 Then 'obviously don't do anything if no button is down
ReleaseCapture(Me.Hwnd)
Call SendMessage(Me.Hwnd, WM_SYSCOMMAND, 0, 0)
End If


I don't have VB here but this is almost exactly what you need.