c# - How Can I Set The Windows Form Position Manually -


i developing desktop application, loads form different texts , condition when click ok button shows texts form 1 one

it working problem have more 1 screen , when load form on current screen , click ok stays @ primary screen ok ,but when load form , drag next screen , click ok comes again primary screen want stay on screen ...where drag

here line of code loads form

if(form1.showdialog(this) == dialogresult.ok) 

// @ line every time click ok shows form in primary screen there solutions can control position mean new position grag into.

you can use form.location property , form.startposition :

// set start position of form 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


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -