[英]How do you determine if an item is selected?
Is there a way to determine if an item, in my case the webbrowser, is selected? 有没有办法确定一个项目,在我的情况下是webbrowser,是否被选中?
example: control.select() = true;
例如: control.select() = true;
note: I know that the example is not correct, but it is only to show an example of what I want. 注意:我知道这个例子不正确,但它只是展示了我想要的一个例子。
When I do a button that executes: webBrowser1.Select();
当我执行一个执行按钮时: webBrowser1.Select();
It selects correctly but if its executed twice. 它选择正确,但如果执行两次。 It becomes unselected. 它没有被选中。
I understand why it happens, but is there way to make it selected that doesn't get unselected if executed twice. 我明白为什么会发生这种情况,但有没有办法让它被选中,如果执行两次则不会被取消选中。
使用ContainsFocus
或Focused
属性来确定控件是否具有焦点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.