| View previous topic :: View next topic |
| Author |
Message |
BoRed Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Apr 2007 Posts: 1176 Location: ╞|ous█
|
Posted: Thu Jul 05, 2007 12:50 pm Post subject: Vb Form positioning (Visual basics tut for form positioning |
|
|
Top Left first:
Mostly the simplest form of ones, all you realy need to do is use
| Code: |
Me . Top = 0
Me . Left = 0 |
Now Center Screen
This will make your form appear in the center of your screen no matter the resolution.
| Code: |
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2 |
Top Middle
This is great if you have various other forms that are not on your main form and you want them to be visible.
| Code: |
Me.Top = 0
Me.Move (Screen.Height - Me.Height) \ 2 |
Hope it all works out
_________________
I got my old name back.......=)
Working on making website for stealth trainers (almonst done just having technical troubles)
Stealth forums will be down for 8 days or more starting august 2 saturday. |
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Wed Jul 11, 2007 11:57 am Post subject: |
|
|
| hmm.. nice
|
|
| Back to top |
|
 |
Labyrnth Moderator
Reputation: 10
Joined: 28 Nov 2006 Posts: 6301
|
Posted: Wed Jul 11, 2007 7:11 pm Post subject: |
|
|
Dude just drag it to the location you want in the dev.
Only reason you need to do it this way is if you wanted it to move during runtime or resize.
Hiding?
And it is not a good idea to have forms open your not using.
|
|
| Back to top |
|
 |
jammie Newbie cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 12
|
Posted: Thu Jul 12, 2007 5:14 am Post subject: |
|
|
but its good for splash screens and to make look everything neat when you cant be bothered to find out someones resolution! (also alot simpler coding than a weird case select)
CE 5.3 opens in the centre when you open that and i think its perfect like that!
|
|
| Back to top |
|
 |
Labyrnth Moderator
Reputation: 10
Joined: 28 Nov 2006 Posts: 6301
|
Posted: Thu Jul 12, 2007 4:56 pm Post subject: |
|
|
| jammie wrote: | | but its good for splash screens and to make look everything neat when you cant be bothered to find out someones resolution! |
Center screen, will be center on anyones screen if you drag it to that location in the dev as well. No need to know the res at all.
|
|
| Back to top |
|
 |
NeoB Newbie cheater
Reputation: 0
Joined: 22 Jul 2007 Posts: 10
|
Posted: Sun Jul 29, 2007 11:41 pm Post subject: It could be better |
|
|
Mmm this one for C# Tut
Location is similar to Point class and there other way to change a value:
| Code: |
Location = new Point(X,Y);
|
and there is a simple startposition properties that it automatically can position position to middle or original window position:
| Code: |
this.StartPosition = FormStartPosition.CenterScreen;
|
The CenterScreen is a type and it pretty much gathered the values in your screen and position into the middle.
If you despise to have a user to change position of your Form then you can do a Override.
| Code: |
protected override void OnMove(EventArgs e)
{
base.OnMove(e);
Location = new Point(X,Y);
}
|
|
|
| Back to top |
|
 |
|