C#如何得到文本框里光标坐标????? C#如何得到文本框里光标坐标?????是坐标(x,y),,不是位置,, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void textBox1_MouseMove(object sender, MouseEventArgs e){ this.textBox1.Text = string.Format("({0}, {1})", e.X, e.Y);} [DllImport("user32.dll")] public static extern bool GetCursorPos(out Point pt); Point CursorPosition; GetCursorPos(out CursorPosition); private void textBox1_MouseMove(object sender, MouseEventArgs e) { int tempWidth = e.X; } 使用GetCursorPos方式,,打出值为 1.69759663672474E-313 因为win7原因吗? 现在用GetCursorPos方式,不管我光标在何处,,y值始终为0.。 [DllImport("user32.dll", EntryPoint = "GetCursorPos")]public static extern int GetCursorPos(ref POINTAPI lpPoint);private void button3_Click(object sender, EventArgs e){ POINTAPI pt = new POINTAPI(); GetCursorPos(ref pt); MessageBox.Show(pt.x.ToString() + "," + pt.y.ToString());} 呵呵,不好意思啊,没说明白。楼上的方法在winform中可以使用,,,,,,我现在是在WPF项目中。。以上方法不能用了 截取问题 C#获取打印机状态 代码使treeview节点响应单击事件 e.Location动态数字显示 请高手进共同讨论:动态调用dll中方法的问题 求助sql存储过程读取字符串问题,急,在线等 简单问题:怎样得到今天是星期几?以及当前这个礼拜的其实日期和结束日期? 利用api得到某应用程序中一个文本框的句柄,有什么方法让这个文本框失去焦点? 多了一个角角,庆祝一下,顺便问问题:) C#调用Oracle存储过程其中传入的参数有数组 求基于TCP的socket代码(C#的),含有服务器端和客户端 用C# winform程序开启windows服务 怎么做?
{
this.textBox1.Text = string.Format("({0}, {1})", e.X, e.Y);
}
public static extern bool GetCursorPos(out Point pt); Point CursorPosition; GetCursorPos(out CursorPosition);
private void textBox1_MouseMove(object sender, MouseEventArgs e)
{
int tempWidth = e.X;
}
现在用GetCursorPos方式,不管我光标在何处,,y值始终为0.。
public static extern int GetCursorPos(ref POINTAPI lpPoint);private void button3_Click(object sender, EventArgs e)
{
POINTAPI pt = new POINTAPI();
GetCursorPos(ref pt);
MessageBox.Show(pt.x.ToString() + "," + pt.y.ToString());
}