
-----------------------------------
tifg
Fri Dec 15, 2006 6:14 pm

moving a cmd box
-----------------------------------
can someone tell me how to move a command box when you try to move your cursor over it? so when ur cursor croses a certain threshold(lets say the border of your cmd box), the cmd box itself moves in the opposite direction

-----------------------------------
Silent Avenger
Fri Dec 15, 2006 8:04 pm


-----------------------------------
One thing you should know, don't post twice in two different forums and if it's  question it belongs here and not in tutorials. As for your question you'd use the mouse move event and the x, y co-ordinates to check which side the cursor came from. Also if you want to move the command button you'd use the top and left properties of the command button.

-----------------------------------
tifg
Sun Dec 17, 2006 3:33 pm


-----------------------------------
yea my bad.. i posted there first then i realized i should have posted here... 
can u maeby give me a little piece of code? cuz i dont really kno wut ur talking abt.. thnx

-----------------------------------
Silent Avenger
Sun Dec 17, 2006 9:12 pm


-----------------------------------
Okay try this code out:Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Caption = X & "    " & Y
End Sub

Put a command button on your form (make sure it's fairly large) and put this code in. when you run the program and move your mouse over the command button you'll see the numbers appear in the command button. Make sure you record the coordinates that you get for each edge of the command button (eg. for the left side of the command button x would = 0 and y always changes) By knowing this you can construct if statements that will determine which side the mouse came from. Also the properties that you wish to modify will move the command button around the form using a grid type system so if you use the Command1.top = property it will move the command button up or down depending on the number you input, same with the Command1.left = property. Hope this helps.[/code]

-----------------------------------
tifg
Mon Dec 18, 2006 5:09 pm


-----------------------------------
yea thanks man.. that helps alot
