的WinForms:插入符位置的屏幕位置 [英] Winforms: Screen Location of Caret Position
本文介绍了的WinForms:插入符位置的屏幕位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何能找到符的一个标准的WinForms文本框在屏幕上的位置?
How can I find the screen position of the caret for a standard Winforms TextBox?
推荐答案
您只能使用本机互操作做到这一点:的 GetCaretPos
You can do it only with native interop: GetCaretPos
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetCaretPos(out Point lpPoint);
这篇关于的WinForms:插入符位置的屏幕位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文