form problem

  • Thread starter Thread starter frazer
  • Start date Start date
F

frazer

hi
i want to store user preferences
like when teh app was last opened i want to store the window height and
width. and then display the form in the same position to the user the next
time the app starts.
i store this.height in a xml file and then read the xml file and assign
that height to the form.
its the same height but it doesnt display it in the last opened position.
my form has

this.StartPosition = FormStartPosition.Manual

what am i doing wrong?
 
frazer said:
i want to store user preferences
like when teh app was last opened i want to store the window height and
width. and then display the form in the same position to the user the next
time the app starts.
i store this.height in a xml file and then read the xml file and assign
that height to the form.
its the same height but it doesnt display it in the last opened position.
my form has

this.StartPosition = FormStartPosition.Manual

Hi Frazer,

simply add the Location in InitializeComponent:

private void InitializeComponent()
{
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Location = new Point(<LocationXFromXmlFile>,
<LocationYFromXmlFile>);
}

Cheers

Arne Janning
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top