how to start a form in a specific location
-
I would like to start a second form relative to the first form. frmMain is the first form, frmView2 is the second form being opened by frmMain:
frmView2 FView2 = new frmView2(); FView2.Show();
In frmView2 I have:
this.Location = windowpoint;
How do I properly pass a Point from frmMain to frmView2? Thank you
-
I would like to start a second form relative to the first form. frmMain is the first form, frmView2 is the second form being opened by frmMain:
frmView2 FView2 = new frmView2(); FView2.Show();
In frmView2 I have:
this.Location = windowpoint;
How do I properly pass a Point from frmMain to frmView2? Thank you
You have to set the starting location ( there's a property, and I forget it, sorry ), before you show it. You can set it to center screen, center parent, or you can set it to manual, and then setting the position will work.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You have to set the starting location ( there's a property, and I forget it, sorry ), before you show it. You can set it to center screen, center parent, or you can set it to manual, and then setting the position will work.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
You have to set the starting location ( there's a property, and I forget it, sorry ), before you show it. You can set it to center screen, center parent, or you can set it to manual, and then setting the position will work.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
this.StartPosition = FormStartPosition.CenterScreen;
-
I would like to start a second form relative to the first form. frmMain is the first form, frmView2 is the second form being opened by frmMain:
frmView2 FView2 = new frmView2(); FView2.Show();
In frmView2 I have:
this.Location = windowpoint;
How do I properly pass a Point from frmMain to frmView2? Thank you
Hi, 1. you need to set Form.StartPosition to Manual 2. you could pass a Point through a second Form constructor, through a new property, and many other ways. However, you don't have to, you could also set the position in the main form, just before showing the new one. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
Hi, 1. you need to set Form.StartPosition to Manual 2. you could pass a Point through a second Form constructor, through a new property, and many other ways. However, you don't have to, you could also set the position in the main form, just before showing the new one. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
-
I set the point with this.Location in the first form and set the adjusted point just before frmView2.Show thanks!!
you're welcome. :)
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages