Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 C# 的 Winforms RichTextBox 中找到当前鼠标光标位置的 X/Y 像素坐标。我该怎么做?
这应该有效:
Point p = new Point(Cursor.Position.X, Cursor.Position.Y); int mx = richTextBox1.PointToClient(p).X; int my = richTextBox1.PointToClient(p).Y;