如何知道TextBox是否包含输入光标? [英] How to know whether a TextBox includes the input cursor?

查看:120
本文介绍了如何知道TextBox是否包含输入光标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何布尔函数返回TextBox是否具有输入光标?

它应该看起来像这样:

Is there any boolean function that returns whether a TextBox has the input cursor in it or not?

it should look like this:

if(textBox1.HasCursor)
{
    //do something
}

推荐答案

使用 ^ ],以查看哪个元素具有焦点(当然还有与之相关的光标).
Use Keyboard.FocusedElement[^] to see which element has the focus (and of course the cursor that goes with it).


Control.Focused [
Control.Focused[^]. (If a text box has the focus, then by definition it also has the input cursor.)


这篇关于如何知道TextBox是否包含输入光标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆