弹出窗口定位 我做了一个自定义控件,有一个button,textbox,和一个form 点击一个button form弹出 刚好停靠在textbox的下面 但是当我把控件拖到panel 上 form的位置并不能 停靠在textbox的下面 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 具体怎么设置?form.StartPosition = FormStartPosition.Manual;form.Location = new Point(this.Parent.Location.X + this.Left + 4, this.Parent.Location.Y + this.Top + this.Height + 30);我是这样设置的 但会出现上面我说的那种问题 控件在panel上的时候可能this.parent不是控件本身,你show这个form时候指定一下 我自己解决了 if (this.Parent.Parent == null) { form.Location = new Point(this.Parent.Location.X + this.Left + 4, this.Parent.Location.Y + this.Top + this.Height + 30); } else { form.Location = new Point(this.Parent.Parent.Location.X + this.Parent.Left+this.Left + 4, this.Parent.Parent.Location.Y +this.Parent.Top+ this.Top + this.Height + 30); } 如何控制TreeView的尺寸? asp.net 关于c# webbrowser编程的 WPF中Window能被容器包含不?有什么方法吗? dataGridView显示的问题 问一个winform的DataGridView 的刷新问题 上报项目系统,客户端向服务器端提交数据库信息,两个不同ip ,不同网端的数据库操作怎么实现 请教关于强名称的问题. C#如何判断txt中特定内容所在的位置 如何锁定对话框的大小 Spread控件自定义组合键进行黏贴 C#程序开发范例宝典 好吗 WPF打印问题
form.StartPosition = FormStartPosition.Manual;
form.Location = new Point(this.Parent.Location.X + this.Left + 4, this.Parent.Location.Y + this.Top + this.Height + 30);
我是这样设置的
但会出现上面我说的那种问题
if (this.Parent.Parent == null)
{
form.Location = new Point(this.Parent.Location.X + this.Left + 4, this.Parent.Location.Y + this.Top + this.Height + 30);
}
else
{
form.Location = new Point(this.Parent.Parent.Location.X + this.Parent.Left+this.Left + 4, this.Parent.Parent.Location.Y +this.Parent.Top+ this.Top + this.Height + 30);
}