关于子窗口相对父窗口位置的问题(Winform) 我想在主窗体上添加一个按钮,点击这个按钮之后弹出一个没有边框的子对话框,让这个子对话框的左、右、下三边和主窗体的左、右、下边重合,子窗体的上边比主窗体的上边低20个像素,应该怎么实现呀,请高手指点下,自己摸索了会,没整出来。谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Form fmDialog = new Form();fmDialog.StartPosition = FormStartPosition.Manual;fmDialog.FormBorderStyle = FormBorderStyle.None;fmDialog.Size = new Size(宽度,高度);//fmDialog.Location = new Point(x位置,y位置);fmDialog.ShowDialog();//主窗口的上下左右,为this.Top;this.Bottom;this.Left;this.Right;直接取来用就行 private void button1_Click(object sender, EventArgs e) { Form3 frm3 = new Form3(); frm3.MdiParent = this; frm3.Show(); frm3.Width = this.Width; frm3.Left = 0; frm3.Top = 20; frm3.Height = this.Height-20; }给你个笨办法 Form1 fm= new Form1();frm.MdiParent=this;frm.Width=this.Width;frm.Height=this.Height;frm.Top=数值;frm.Show(); frm.WindowState = FormWindowState.Maximized MDI子窗口Height=父窗口Height-20,Dock=DockStyle.Buttom this.IsMdiContainer = true; this.Size = new Size(500, 500); Form F = new Form(); F.Height = this.ClientRectangle.Height - 20; F.MdiParent = this; F.Show(); F.Dock = DockStyle.Bottom; C#字符串和正则表达式参考手册【pdf】下载 随机生成的十位数 datagrid 如何在鼠标滑动时调用后台方法 绘制cpu使用率 如何实现点击datagridview列表头不排序? 说编程语言不重要的过来看看 在自己的程序中如何将IE的界面集成进来 各位高手,能给我这个菜鸟介绍一本学习C#的好书吗? 新手~~关于System.Collections.ArrayList类的.Item 属性疑惑~~~ 有人知道谷歌Gmail api 怎么用吗? c# readewritelock 如何用C#向word表格导出数据
Form fmDialog = new Form();
fmDialog.StartPosition = FormStartPosition.Manual;
fmDialog.FormBorderStyle = FormBorderStyle.None;
fmDialog.Size = new Size(宽度,高度);//
fmDialog.Location = new Point(x位置,y位置);
fmDialog.ShowDialog();
//主窗口的上下左右,为this.Top;this.Bottom;this.Left;this.Right;直接取来用就行
private void button1_Click(object sender, EventArgs e)
{
Form3 frm3 = new Form3();
frm3.MdiParent = this;
frm3.Show();
frm3.Width = this.Width;
frm3.Left = 0;
frm3.Top = 20;
frm3.Height = this.Height-20;
}给你个笨办法
frm.MdiParent=this;
frm.Width=this.Width;
frm.Height=this.Height;
frm.Top=数值;
frm.Show();
this.Size = new Size(500, 500); Form F = new Form();
F.Height = this.ClientRectangle.Height - 20;
F.MdiParent = this;
F.Show();
F.Dock = DockStyle.Bottom;