【问题标题】:Find coords of mouse cursor position in RichTextBox在 RichTextBox 中查找鼠标光标位置的坐标
【发布时间】:2012-12-16 15:57:39
【问题描述】:

我想在 C# 中的 Winforms RichTextBox 中找到当前鼠标光标位置的 X/Y 像素坐标。我该怎么办?

【问题讨论】:

标签: c# winforms cursor mouse richtextbox


【解决方案1】:

这应该可行:

Point p = new Point(Cursor.Position.X, Cursor.Position.Y);
int mx = richTextBox1.PointToClient(p).X;
int my = richTextBox1.PointToClient(p).Y;

【讨论】:

    猜你喜欢
    • 2012-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多