一个控件中的鼠标事件,如何计算定位一个右键菜单.需要哪些坐标?如何获得坐标?

code2004 2009-06-15 06:18:11
谢谢
...全文
106 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
teerhu 2009-06-15
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 yhb417 的回复:]
右键菜单定位到一个按钮的下面


C# code
private void button1_Click(object sender, EventArgs e)
{
this.contextMenuStrip1.Show(this, this.button1.Location.X, this.button1.Location.Y + this.button1.Height);
}
[/Quote]
支持
修改一下昵称 2009-06-15
  • 打赏
  • 举报
回复
右键菜单定位到一个按钮的下面


private void button1_Click(object sender, EventArgs e)
{
this.contextMenuStrip1.Show(this, this.button1.Location.X, this.button1.Location.Y + this.button1.Height);
}
PandaIT 2009-06-15
  • 打赏
  • 举报
回复

string.Format("X坐标{0}Y坐标{1}",e.X,e.Y);

111,110

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧