获取屏幕坐标问题。 本人重写了toolstripcomboBox,点击下拉的时候弹出一个窗体,请问怎样获取toolstripcomboBox相对于屏幕的坐标,使窗体弹出是出现在toolstripcomboBox的下方? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 this.Location 获得主窗口的PointtoolstripcomboBox.Location 获得该空间相对主窗口的Point你要弹出的窗口的Location.X = this.Location.X + toolstripcomboBox.Location.X;你要弹出的窗口的Location.Y = this.Location.Y + toolstripcomboBox.Location.Y + toolstripcomboBox.Height; Point p = new Point(0,this.toolstripcomboBox.Height); //下方 Point p = toolstripcomboBox.Location; p.Y += toolstripcomboBox.Height; 没有这个toolstripcomboBox.Location属性。 这应该是你要的吧左上角横坐标: toolStripComboBox1.Bounds.X左上角纵坐标: toolStripComboBox1.Bounds.Y控件高度: toolStripComboBox1.Height左下角纵坐标: toolStripComboBox1.Bounds.Y + toolStripComboBox1.Height 这应该是你要的吧左上角横坐标: toolStripComboBox1.Bounds.X左上角纵坐标: toolStripComboBox1.Bounds.Y控件高度: toolStripComboBox1.Height左下角纵坐标: toolStripComboBox1.Bounds.Y + toolStripComboBox1.Height 谢谢各位,终于解决了这问题。//要显示的FormForm form=new Form();form.StartPosition=FormStartPosition.Manuul;Point p=this.Owner.PointToScreen(new Point(this.Bounds.X,this.Bounds.Y));form.Location=new Point(p.X,p.Y+this.Size.Height); 帮忙看看xml文档的命名空间和前缀为什么取不到? C# 怎么提高打印图片的质量或怎么打印图片 请教高手,文本框的双击事件调出另一窗体 如何将光标移动到指定的位置?比如说移动到textbox框中的字符串的末尾! C#中如果定义公共实例 各位大侠。帮忙看个问题(数据导出到Execl) DataTable操作 鉴于很多.net程序员对于问题的解答不够热情,个人做出重大决定转换工作空间了 如何获得某类在app中的实例数目,急 请问各位,到底Visual Studio 7.0正式版本出来了没有?我看到了盗版的,但我不知是不是正式版本?? C#投票,计票软件 WCF如何在需要时将它线程停止运行
toolstripcomboBox.Location 获得该空间相对主窗口的Point
你要弹出的窗口的Location.X = this.Location.X + toolstripcomboBox.Location.X;
你要弹出的窗口的Location.Y = this.Location.Y + toolstripcomboBox.Location.Y + toolstripcomboBox.Height;
Point p = toolstripcomboBox.Location;
p.Y += toolstripcomboBox.Height;
左上角横坐标: toolStripComboBox1.Bounds.X
左上角纵坐标: toolStripComboBox1.Bounds.Y
控件高度: toolStripComboBox1.Height左下角纵坐标: toolStripComboBox1.Bounds.Y + toolStripComboBox1.Height
左上角横坐标: toolStripComboBox1.Bounds.X
左上角纵坐标: toolStripComboBox1.Bounds.Y
控件高度: toolStripComboBox1.Height左下角纵坐标: toolStripComboBox1.Bounds.Y + toolStripComboBox1.Height
//要显示的Form
Form form=new Form();
form.StartPosition=FormStartPosition.Manuul;
Point p=this.Owner.PointToScreen(new Point(this.Bounds.X,this.Bounds.Y));
form.Location=new Point(p.X,p.Y+this.Size.Height);