在选项卡控件中更改选项卡时,下拉菜单仍然存在 [英] Drop down remains when changing a tab in tab control

查看:107
本文介绍了在选项卡控件中更改选项卡时,下拉菜单仍然存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.net Framework 3.5 Windows窗体.

我在一个标签控件上有三个标签
在第一个选项卡上,具有自动建议模式的下拉菜单
当我在下拉菜单中选择一个与下拉菜单中的任何值都不匹配的值时,下拉菜单将提示所有值
当我更改选项卡时,下拉菜单的建议值在下一个选项卡中可用.
我可以在此选项卡中选择值,当我检查第一个选项卡时,下拉列表具有选定的值
移至其他选项卡时如何隐藏下拉菜单.
当该值与下拉列表中的记录匹配时,不会出现问题,因为在选项卡上可以选择该值.

我在这里附加了图片:
选择下拉菜单时
http://imgur.com/AE4qD

标签更改时
http://i.imgur.com/DBfov.jpg

I am using .net framework 3.5 windows forms.

I have three tabs on a tab control
On the first tab there is a drop down with auto suggest mode
When I select a value in the drop down which does not match any value in the drop down, the drop down suggets all values
When I change the tab the suggested value of the drop down is available in the next tab.
I can select the value in this tab and when I check the first tab the drop down has the selected value
How to hide the drop down when moving to othe tabs.
When the value is matching a record in the drop down the problem does not occur as on tab chnage it selects the value.

I have attached images here:
When drop down is selected
http://imgur.com/AE4qD

When tab is changed
http://i.imgur.com/DBfov.jpg

推荐答案

这似乎是下拉菜单的AugoSuggest功能中的错误.您可以尝试在标签不可见时关闭自动建议",然后在选择标签时将其打开.

我没有测试过这段代码,只是出于我的想法:
It seems to be a bug in the AugoSuggest feature of the dropdown. You can try turning off Auto suggest when the tab becomes invisible and then turn it on when the tab is selected.

I haven''t tested this code, just out of my mind:
void TabChanged(........) {
    if (tabControl.SelectedIndex = 0) { //First tab
        //Turn on auto suggest
    } esle {
        //Turn off auto suggest
    }
}


这篇关于在选项卡控件中更改选项卡时,下拉菜单仍然存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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