Why am I not able to change form location in method?
I have a form with a load event and in that I am changing location. This
code works fine:
private void MainForm_Load(object sender, EventArgs e)
{
this.Location = new Point(1200,500); // as example
}
But if I give the location change to a method and call this method from
load event, it does not work.
private void MainForm_Load(object sender, EventArgs e)
{
ChangeLocation();
}
private void ChangeLocation()
{
this.Location = new Point(1200,500); // as example
}
I am wondering why it can't be in method. Thank you
No comments:
Post a Comment