|
-
Aug 29th, 2005, 10:32 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Move Form1
How can I change the position of form1 on the screen with code.
-
Aug 29th, 2005, 10:33 PM
#2
Re: Move Form1
Form1.left=500, form1.top=500
-
Aug 29th, 2005, 10:45 PM
#3
Re: Move Form1
If you intend to change both the X and Y coordinate it is better to set the Location property rather than the Top and Left individually, which is actually visible to the user, e.g.
VB Code:
form1.Location = New Point(500, 500)
-
Aug 29th, 2005, 11:18 PM
#4
Thread Starter
Addicted Member
-
Aug 29th, 2005, 11:22 PM
#5
Thread Starter
Addicted Member
Re: [RESOLVED] Move Form1
Well its marked as resolved already, but I don't want to start a new thread for the same issue.
VB Code:
Form1.Left = Form1.Left + 200
Form1.Top = Form1.Top + 200
Why is that not working.
-
Aug 29th, 2005, 11:32 PM
#6
Re: [RESOLVED] Move Form1
I'm going to guess that "Form1" is the name of a class. These are instance members, which means that you can only change their values for a specific instance of Form1, e.g.
VB Code:
Dim myForm1 As New Form1
myForm1.Left += 200
myForm1.Top += 200
-
Aug 29th, 2005, 11:34 PM
#7
Re: [RESOLVED] Move Form1
If you want to use any members of the current instance you qualify them with "Me", e.g.
VB Code:
Me.Left += 200
Me.Top += 200
Strictly speaking the "Me." is not required, but it is good practice to include it for clarity and it means you get help from Intellisense as well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|