搜索字母名称 [英] to search alphabetical name

查看:79
本文介绍了搜索字母名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#Windows应用程序中,我具有cboSearch(组合框)和cboNames(组合框).

cboSearch中有从A到Z的字母.
当我从cboSearch中选择B时,我想在以B开头的cboNames中显示名称.

请给我建议.

In C# windows application I have cboSearch(combo box) and cboNames(combo box).

There are the letters from A to Z in cboSearch.
When I choose B from cboSearch, I want to show the names in cboNames which starts B.

Advise me,pls.

推荐答案

在cboSearch的SelectedIndexChanged事件处理程序中,只需清除cboNames并仅在其中填充相应的起始字母即可.

您可以使用(string)(cboSearch.SelectedItem)
In the SelectedIndexChanged event handler of cboSearch, just clear cboNames and fill only the names with the according starting letter in there.

You can get the selected letter with (string)(cboSearch.SelectedItem)


这篇关于搜索字母名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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