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
Post a Comment