I am developing Desktop application, which loads a Form with different Texts and condition is so When i Click ok Button it shows Texts from the Form one by one
it is working perfectly but the Problem is i have more than one screen and say when i load a form on Current screen and click OK it stays at primary screen which is Ok ,but say when i load my form and drag it to next screen and click ok its comes back again to Primary Screen But i want it to stay on another Screen ...where i drag it into
here is line of code which loads my form
if(Form1.ShowDialog(this) == DialogResult.OK)
// at this line every time i click ok it shows the form but in Primary Screen so is there any solutions i can control the position i mean new position where i grag it into.
You can use Form.Location
property and Form.StartPosition
:
// Set the start position of the form to the manual.
form1.StartPosition = FormStartPosition.Manual;
form1.Location = new Point(100, 100);
More information :
https://msdn.microsoft.com/en-us/library/aa984420(v=vs.71).aspx
https://msdn.microsoft.com/en-us/library/system.windows.forms.form.startposition(VS.80).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With