Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > Form movement


Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2003, 02:10 AM
Peperl's Avatar
Peperl Peperl is offline
Senior Contributor
 
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
Default 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?
__________________
Pri Oh Persia
Reply With Quote
  #2  
Old 11-03-2003, 02:15 AM
Myth's Avatar
Myth Myth is offline
Contributor
 
Join Date: Oct 2003
Location: Under your bed
Posts: 792
Default

at which point are u actually specifieng what button equals to?
__________________
Please use [vb][/vb] tags when posting.
Reply With Quote
  #3  
Old 11-03-2003, 02:22 AM
Peperl's Avatar
Peperl Peperl is offline
Senior Contributor
 
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
Default

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.
__________________
Pri Oh Persia
Reply With Quote
  #4  
Old 11-03-2003, 03:36 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 18,887
Default

Reply With Quote
  #5  
Old 11-04-2003, 07:50 AM
Peperl's Avatar
Peperl Peperl is offline
Senior Contributor
 
Join Date: Apr 2003
Location: Cartagena, Spain
Posts: 1,371
Smile

Thanks for the reply FlyGuy. It sounds great, I'm gonna try and I comment it is the post
__________________
Pri Oh Persia
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MDI Form and dimensions kkonkle Interface and Graphics 6 03-26-2003 09:50 AM
Disable Mouse Scroll in Sub Form nickg96 Database and Reporting 16 10-04-2002 11:12 AM
WinSock vbsupernewbie Communications 1 09-12-2001 10:20 PM
Create a new form similar to an existing form ric General 6 07-17-2001 12:47 AM
Form to form data movement Bobn General 7 03-16-2001 08:01 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->