Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EOv2] Movable GUI Windows


Whackeddie99
 Share

Recommended Posts

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 image
Private 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 = Y
End 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 if
End Sub
```
```
Private Sub imgCharacter_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dragging = False
End 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

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

@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

@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

  • 3 weeks later...
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 If
End Sub
```
Link to comment
Share on other sites

@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

@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?
wat

Oh, 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

  • 3 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...