Commit f0fbcaa0 HZH

解决停靠窗体在父控件位置改变时无法关闭的问题

1 个父辈 d2cd7cc8
......@@ -73,6 +73,21 @@ namespace HZH_Controls.Forms
intY += deviation.Value.Y;
}
this.Location = new Point(intX, intY);
if (parentControl.FindForm() != null)
{
Form frmP = parentControl.FindForm();
if (!frmP.IsDisposed)
{
frmP.LocationChanged += frmP_LocationChanged;
}
}
parentControl.LocationChanged += frmP_LocationChanged;
}
void frmP_LocationChanged(object sender, EventArgs e)
{
this.Close();
}
public FrmAnchor(Control parentControl, Size size, Point? deviation = null)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!