This will open multiple forms of the same class, keeping track of where the last one was closed and opening the new ones there plus an offset.
class mychildforms
{
public in x,y;
public string name;
}
on your MDI parent
List<mychildforms> childlist = new List<mychildforms>();
on your close event handler methods
mychildforms mcf;
//need to overrid and maybe overload indexof
if (MDIParent.childlist.IndexOf(this.name) >=0)
{
mcf = MDIParent.childlist[MDIParent.childlist.IndexOf(this.name)]
mcf.x = this.x;
mcf.y = this.y;
}
else
{
mcf = new mychildforms();
mcf.name = this.name;
mcf.x = this.x;
mcf.y = this.y;
MDIParent.childlist.Add(mcf);
}
on the shown (maybe handlecreated) event handler method
//form default x,y = 0,0
mychildforms mcf;
//need to overrid and maybe overload indexof
if (MDIParent.childlist.IndexOf(this.name) >=0)
{
mcf = MDIParent.childlist[MDIParent.childlist.IndexOf(this.name)]
this.x = mcf.x + xoffset;//or simply the value of x
this.y = mcf.y + yoffset;//or simply the value of y
}
its 2AM so the indexof probably needs something but you get the gist.