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

Odd mousedown/mouseup/mousemove/ moving form problem


Jeff
 Share

Recommended Posts

so, I had a nice and dandy system for moving the little inventory, character, spell, etc menus around on the screen.  I used this tutorial: http://www.touchofdeathforums.com/smf/index.php/topic,67261.0.html

However I noticed that using this system, it is a pain to put spells in the hotbar, and whenever you click on an item in a menu that's draggable it also moves the menu.  So I came up with a system like this:

```
Sub picCharacter_MouseDown
If Y < picCharacter.height - 258 Then
        XM1 = X
        YM1 = Y
        cb = 1
    End If
```
```
Sub picCharacter_MouseMove
If Button = 1 Then
        If cb = 1 Then
            picCharacter.Left = picCharacter.Left + X - XM1
            picCharacter.top = picCharacter.top + Y - YM1
        End If
    End If
```
```
Private Sub picCharacter_MouseUp
cb = 0

```this code makes it so only the top part of the menu is draggable, but the problem is that it only responds sometimes, as if cb would sometimes equal zero.

Why is this?

Thanks! :D
Link to comment
Share on other sites

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...