 |

11-03-2003, 02:10 AM
|
 |
Senior Contributor
|
|
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
|
|
Form movement
|
Hi everbody. I have a doubt.
I have an usercontrol (it's a bar, where I put the name of the form), and I want that when I move it, the form move too. Then, I put this lines in the UserCotnrol:
Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
oldX = X
oldY = Y
End If
End Sub
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button = vbLeftButton) Then
UserControl.Parent.Move UserControl.Parent.Left + (X - oldX), UserControl.Parent.Top + (Y - oldY)
DoEvents
End If
End Sub
And works fine, but the form left a "tail" as I move it, and when I move it very faster appears me an error sayn that the memory of the battery is insuficient (the original palabra is PILA in Spanish, I suposse that the traduction in English was battery)
How can I done for the form moves correctly?
|
|

11-03-2003, 02:15 AM
|
 |
Contributor
|
|
Join Date: Oct 2003
Location: Under your bed
Posts: 792
|
|
|
at which point are u actually specifieng what button equals to?
|
__________________
Please use [vb][/vb] tags when posting.
|

11-03-2003, 02:22 AM
|
 |
Senior Contributor
|
|
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
|
|
|
Button is a Visual Basic variable. When you define an Mouse_Move event (for example), is something like this:
Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
where Button is the button pressed to the usercontrol, shift i don't know what it and X and Y are the position of the mouse.
|
|

11-03-2003, 03:36 PM
|
 |
Lost Soul
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Vorlon
Posts: 18,887
|
|
|

11-04-2003, 07:50 AM
|
 |
Senior Contributor
|
|
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
|
|
|
Thanks for the reply FlyGuy. It sounds great, I'm gonna try and I comment it is the post
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|