c窗体依附于A窗体
在A窗体中添加如下代码:
Form c = new Form();
protected override void OnLoad(EventArgs e)
{base.OnLoad(e);
//c.Show(this);
}
protected override void OnLayout(LayoutEventArgs levent)
{
base.OnLayout(levent);
c.Height = this.Height;
c.Top = this.Top;
c.Left = this.Right;
}
protected override void OnLocationChanged(EventArgs e)
{
base.OnLocationChanged(e);
c.Height = this.Height;
c.Top = this.Top;
c.Left = this.Right;
}