简体   繁体   English

如何确定是否选择了某个项目?

[英]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. 我明白为什么会发生这种情况,但有没有办法让它被选中,如果执行两次则不会被取消选中。

使用ContainsFocusFocused属性来确定控件是否具有焦点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在组合框中,如何确定突出显示的项目(未选择项目)? - In a combobox, how do I determine the highlighted item (not selected item)? 如何确定选定的GridView项目? - How to determine selected gridview item? 如何使用组合框所选项目的值? - How do you use the value of the combobox selected item? 如何获得所选项目的索引号? - How do you get the index number of the item being selected? 如何从Silverlight AutoCompleteBox中获取所选项目? - How do you get the selected item from a Silverlight AutoCompleteBox? 当用户从BottomAppBar固定时,如何确定选择了哪个ListView项目及其Url - How do I determine which ListView item, and it's Url, was selected when the user pins from the BottomAppBar C#:如何确保在执行操作之前在 ListView 中选择了行或项目? - C#: How do you make sure that a row or item is selected in ListView before performing an action? C#:如何确定在ListView中选择了哪个项目索引? - C#: How do you tell which item index is selected in ListView? 如果您的Outlook具有多个帐户,如何为所选帐户添加新的联系人项目? - If you have Outlook with multiple accounts, how do I add a new Contact Item for a selected account? 如何在没有Viewbag,ViewData或JavaScript的情况下动态确定下拉列表中的选定项目 - How to dynamically determine the selected item in a dropdownlist without viewbag, viewdata, or JavaScript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM