本文介绍了组合框过滤的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个组合框,显示第1列中的所有学生姓名,如果我想找名字叫杰克,我会输入少数字符说JAC,自动组合框会指向我最近的名字从JAC开始,


我怎样才能在组合框列表中显示那些以JAC开头的学生名...,并隐藏那些无法启动的学生姓名与JAC。

解决方案



为此你可以使用listview和textbox,因为如果你想在comboBox中这样做,你必须清除组合列表,也可以清除组合文本。


所以,你可以更好地使用listview和textbox




我知道如何在List框中构建它,但可能不适合我当前的表单开发,你介意通过清除组合列表来解释你的意思和组合文本。




''您可以以编程方式更改组合框的RowSource属性。假设组合框名称为cboTest,其列数= 1,绑定列= 1,RowSourceType =表/查询,以及tblEmployees中的[FirstName]字段:

展开 | 选择 | Wrap | 行号

I have create a combo box, which show all student names in the 1st column, If I want to find name call Jack, I would type the frist few character say JAC, automatically the combo box will point me to the nearest name that start with JAC,

How can I only show those students names that start with JAC..., in the combo box list, and hide the rest of the student names that not start with JAC.

解决方案


for this better you can use a listview and textbox because if you want to do that in comboBox you have to clear the combo list and there may clearing combo text also.

so, better you can use a listview and textbox


I know how to build this in a List box, but may not suitable in my current form development, would you mind explain what you mean by clea the combo list and combo text.


''You can programmatically change the RowSource Property of the Combo Box. Assuming a Combo Box name of cboTest with Column Count = 1, Bound Column = 1, RowSourceType = Table/Query, and a [FirstName] Field in tblEmployees:

Expand|Select|Wrap|Line Numbers


这篇关于组合框过滤的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 07:39