Wortel Angels Posted July 8, 2012 Author Share Posted July 8, 2012 [![](http://www7.pic-upload.de/thumb/09.07.12/djj8gfm5v34.png)](http://www.pic-upload.de/view-15035261/Unbenannt.png.html)Added in frm_main```Private Declare Function ReleaseCapture Lib "user32" () As LongPrivate Declare Function SendMessage Lib "user32" Alias "SendMessageA" _(ByVal hWnd As Long, _ByVal wMsg As Long, _ByVal wParam As Long, _lParam As Any) As Long```And to make the pic's moveable```Private Sub picCharacter_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)Const WM_NCLBUTTONDOWN = &HA1 Const HTCAPTION = 2 If Button = 1 Then ReleaseCapture SendMessage picCharacter.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0& End If If x > picCharacter.width - 10 Then If Y < -picCharacter.height + 281 Then picCharacter.Visible = False End If End IfEnd Sub```It works but how can i fix it that this gray thing isnt there if i move it Link to comment Share on other sites More sharing options...
JohnPony Posted July 9, 2012 Share Posted July 9, 2012 Is the picCharacter part of the picScreen, Or is it part of the form? Link to comment Share on other sites More sharing options...
Justn Posted July 9, 2012 Share Posted July 9, 2012 Part of the form I have the same problem with the gray appearing when dragging any window across picscreen Link to comment Share on other sites More sharing options...
JohnPony Posted July 9, 2012 Share Posted July 9, 2012 Set the picScreen to stop drawing when your dragging a picturebox over it? And when you stop, refresh and redraw? Link to comment Share on other sites More sharing options...
Wortel Angels Posted July 9, 2012 Author Share Posted July 9, 2012 yes all stops and if you strop moving it will continue Link to comment Share on other sites More sharing options...
Exception Posted July 9, 2012 Share Posted July 9, 2012 The API call stops the thread of execution.You don't need an API for this, you can just cleverly use the MouseDown event, alone, and it won't stop it. Have a go, and if you get stuck, I'll provide a few code snippets. =D Link to comment Share on other sites More sharing options...
Wortel Angels Posted July 9, 2012 Author Share Posted July 9, 2012 Ok i got it :DThanks to gooby http://www.touchofdeathforums.com/smf2/index.php/topic,77908.0.htmlAnd Wing on post #6```Private Sub imgCharacter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If y < -imgCharacter.height + 281 Then Dragging = True prevX = X prevY = Y End IfEnd Sub```But its not an fix its another way to do it ;-) Lenn if you know the fix i think this is good too Link to comment Share on other sites More sharing options...
Joyce Posted July 9, 2012 Share Posted July 9, 2012 ```Static MouseX As Long, MouseY As Long If Button = 1 And DragBankSlotNum = 0 Then If Y < 22 Then TempX = picBank.Left + (X - MouseX) TempY = picBank.top + (Y - MouseY) If TempX < 0 Then TempX = 0 If TempX > (picscreen.scalewidth - picBank.width) Then TempX = (800 - picBank.width) If TempY < 0 Then TempY = 0 If TempY > (picscreen.scaleheight - picBank.height) Then TempY = (480 - picBank.height) picBank.Left = TempX picBank.top = TempY End If Else MouseX = X MouseY = Y End If```^ Taken from picBank's mousemove sub. Another way to do it along with some code to keep it on your picscreen.Anyway, that will always happen because we're using GDI components sliding over it, it will be there in lesser or greater extends unless you convert the menus over to full DirectDraw. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now