Hi, i have a dual monitor setup. i want my app to run in the secondary monitor by default (through settings in my app). i have been browsing the net for a solution and i found a solution which is setting the Form.Bounds to the Bounds of the secondary monitor. my problem is that if i set the bounds of my newly created form, when it gets displayed, it doesn't show in the secondary monitor.
Code:private void button2_Click(object sender, EventArgs e) { Form1 frm = new Form1(); frm.SetBounds(-1280, 112, frm.Bounds.Width, frm.Bounds.Height); MessageBox.Show(string.Format("frm.Bounds [{0},{1}]",frm.Bounds.Left,frm.Bounds.Top)); //frm.Bounds = Screen.AllScreens[1].Bounds; //frm.Location = Screen.AllScreens[1].Bounds.Location; frm.Show(); MessageBox.Show(string.Format("frm.Bounds [{0},{1}]", frm.Bounds.Left, frm.Bounds.Top)); }
in the code above, i first set the bounds, i can see from the message box the settings i assigned.
after form gets displayed, i checked the bounds again, it has changed to it's default![]()
how do i show then a newly created form to a specific Bounds?




Reply With Quote