|
-
Feb 15th, 2002, 01:27 PM
#1
Thread Starter
Addicted Member
[repost] Show window content while dragging
(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...
Any ideas?
VB Code:
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
If you can think it....you can code it....
-
Feb 17th, 2002, 01:47 PM
#2
Thread Starter
Addicted Member
*bump*
anyone?
If you can think it....you can code it....
-
Feb 18th, 2002, 01:09 PM
#3
Frenzied Member
In your form's MouseMove you're going to do something like this...
VB Code:
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|