Whackeddie99 Posted January 29, 2012 Author Share Posted January 29, 2012 Alright guys, first of all no credit to me on this all goes to blkcrow (and maybe a bit to Justn xD).This tutorial will let you make any pic or img movable without a grey background when moving with the other tutorial.~ All Client Side ~At The Top Of frmMain code at the bottom of Events, add:```Dim Dragging As Boolean ' just a flag to know if we are clicking the imagePrivate prevX As Single, prevY As Single```Find the picturebox or image you want to make movable and double click on it, then add these codes for it, adjusting the name to the name of your picturebox.```Private Sub imgCharacter_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dragging = True prevX = X prevY = YEnd Sub``````Private Sub imgCharacter_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If Dragging Then imgCharacter.Move imgCharacter.Left - (prevX - X), imgCharacter.Top - (prevY - Y) end ifEnd Sub``````Private Sub imgCharacter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) Dragging = FalseEnd Sub```That should be it. Open it up and try to drag the box and test it yourself. It may lag a little when moving over the picScreen, but it's a lot better than this:![](http://www.freemmorpgmaker.com/files/imagehost/pics/2c5fc5706250c491eeb9eb7ec864b8bf.png)xD Hope this helped some people! Link to comment Share on other sites More sharing options...
Robin Posted January 30, 2012 Share Posted January 30, 2012 Way, way too much work for a simple fix. This isn't acceptable.Trying to change something because it has a certain effect isn't as simple as you seem to think. If it's creating such an effect then the original system is flawed by design and shouldn't be built upon at all. Link to comment Share on other sites More sharing options...
blkcrow Posted January 30, 2012 Share Posted January 30, 2012 @Robin:> Way, way too much work for a simple fix. This isn't acceptable.> > Trying to change something because it has a certain effect isn't as simple as you seem to think. If it's creating such an effect then the original system is flawed by design and shouldn't be built upon at all.i think you got it wrong the screenshot is from using the ReleaseCapture API my code has nothing to do with it[http://www.touchofdeathforums.com/smf/index.php/topic,77514.0.html](http://www.touchofdeathforums.com/smf/index.php/topic,77514.0.html) Link to comment Share on other sites More sharing options...
Robin Posted January 30, 2012 Share Posted January 30, 2012 I don't know who you are nor did I know it was your code. All I know is that this code is a bad way of doing it and if it's simply a modification of existing stuff then that system was flawed too. Link to comment Share on other sites More sharing options...
Justn Posted January 30, 2012 Share Posted January 30, 2012 So the code above is a bad way to do it? And the code I posted here is bad too(completely different than above) http://www.touchofdeathforums.com/smf/index.php/topic,77514.0.html is there a better way of doing this? Link to comment Share on other sites More sharing options...
Whackeddie99 Posted January 30, 2012 Author Share Posted January 30, 2012 @Robin:> I don't know who you are nor did I know it was your code. All I know is that this code is a bad way of doing it and if it's simply a modification of existing stuff then that system was flawed too.Robin, if both of these ways are 'bad', then stop telling us this and tell us what we should do instead. Just going around saying **this and that are horrible ways of coding** doesn't fucking help. Link to comment Share on other sites More sharing options...
Wing Posted February 18, 2012 Share Posted February 18, 2012 This doesn't work very well. You cannot drag items or skills inside of the picture box. To fix this you can make the picture box drag only when you click the top.```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``` Link to comment Share on other sites More sharing options...
Robin Posted February 19, 2012 Share Posted February 19, 2012 @Whack:> Robin, if both of these ways are 'bad', then stop telling us this and tell us what we should do instead. Just going around saying **this and that are horrible ways of coding** doesn't ducking help.Then you suck at learning. I know for a fact that pointing out that a certain practise is bad pushes people who are willing to learn to read up on better ways of doing things.If you honestly can't find another way of doing something without me explicitly explaining it to you in great detail then you're not cut out for this in the first place. Link to comment Share on other sites More sharing options...
Fuu Posted February 19, 2012 Share Posted February 19, 2012 @Whack:> Robin, if both of these ways are 'bad', then stop telling us this and tell us what we should do instead. Just going around saying **this and that are horrible ways of coding** doesn't ducking help.Telling you what you did wrong doesn't help?watOh, and I did this same thing where you said "your annoying and your thread is stupid".Only difference is that you're serious. Link to comment Share on other sites More sharing options...
santa-clause Posted February 19, 2012 Share Posted February 19, 2012 it works perfectly Link to comment Share on other sites More sharing options...
tslusny Posted May 23, 2012 Share Posted May 23, 2012 i cant move shop with thisEditI solved it i just forgot to rename what pic to move 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