winform窗体跟随窗体
标签:winform c style blog tar http
Form2 frm2 = new Form2();
private void MoveProc()
{
frm2.StartPosition = FormStartPosition.CenterParent;
frm2.Left = this.Left + panel1.Left;
frm2.Top = this.Top + panel1.Top;
}
public Form1()
{
InitializeComponent();
MoveProc();
this.AddOwnedForm(frm2);
frm2.Show();
}
private void Form1_Move(object sender, EventArgs e)
{
MoveProc();
}
private void button1_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.StartPosition = FormStartPosition.CenterParent;
frm2.ShowDialog();
}
条件:
- 缩略图显示包含跟随的窗体
- 跟随的窗体只在主窗体的最上面
- 主窗体能使用ShowDialog()使用其他窗体
FORM1
FORM2
来自为知笔记(Wiz)
winform窗体跟随窗体,搜素材,soscw.com
winform窗体跟随窗体
标签:winform c style blog tar http
原文地址:http://www.cnblogs.com/xe2011/p/3761977.html
评论