怎么记录现在画板中窗口的位置 保存再打开文件 点击节点弹出相应的窗口 窗口也是显示在相同的位置(弹出的窗口是自定义控件)
formclosing事件里面写
try
{
string s = string.Format("{0},{1},{2},{3}", Top, Left, Height, Width);
System.IO.File.WriteAllText("pos.ini", s);
}
catch { }
在load事件里面写
try {
string s = System.IO.File.ReadAllText("pos.ini");
int[] pos = s.Split(',').Select(x => int.Parse(x)).ToArray();
Top = pos[0];
Left = pos[1];
Height = pos[2];
Width = pos[3];
}
catch {}