G
Guest
Hi,
I'm trying to move a secondary form to the main form's center. But this does
not work with the code I try. Can someone explain ?
Form1 is my seond form. And this is menu item click from main form:
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
Point loc = new Point();
Form1 about = new Form1();
loc.X = Location.X + (Size.Width - about.Size.Width) / 2;
loc.Y = Location.Y + (Size.Height - about.Size.Height) / 2;
about.Location = loc;
//about.Show(this);
about.ShowDialog();
}
I'm trying to move a secondary form to the main form's center. But this does
not work with the code I try. Can someone explain ?
Form1 is my seond form. And this is menu item click from main form:
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
Point loc = new Point();
Form1 about = new Form1();
loc.X = Location.X + (Size.Width - about.Size.Width) / 2;
loc.Y = Location.Y + (Size.Height - about.Size.Height) / 2;
about.Location = loc;
//about.Show(this);
about.ShowDialog();
}