我需要在vb中的简单字典 [英] i need simple dictionary in vb

查看:229
本文介绍了我需要在vb中的简单字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

vb.net中简单字典的代码
创建字典时需要哪些控件

code for simple dictionary in vb.net
Which controls needed while creating dictionary

推荐答案

我真的不建议使用GridView和文本框来执行此操作:当字典获取时,它的响应速度将非常慢大(因为您必须在按下键时从服务器重新加载GridView,或者在页面加载时将整个词典加载到javascript中).

与字典关联的自动完成文本框有什么问题?
I wouldn''t really recommend doing this with a GridView and a textbox: it will get extremely slow to react when the dictionary gets large (as you either have to reload the GridView from the server when the key is pressed, or load the entire dictionary into the javascript at page load).

What is wrong with an autocomplete textbox associated with a dictionary?


如果您询问要使用的类,则.NET中的标准字典类为Dictionary<>.

请参阅 http://msdn.microsoft.com/en-us/library/xfhwa508.aspx [^ ]

至于使用什么控件来显示它,则取决于您要执行的操作.它可能像两个文本框一样简单,用户可以在其中键入一个文本框,而另一个文本框将使用匹配的值进行更新.您只需在第一个文本框中处理文本框更改事件.

另外,如果您要显示整个字典(并且不大到不实用的程度),则可以使用从简单的ListBoxListView的任何东西,甚至可以使用网格控件.
If you are asking about what class to use, then the standard dictionary class in .NET is Dictionary<>.

See http://msdn.microsoft.com/en-us/library/xfhwa508.aspx[^]

And as to what control to use to display it, that depends on what you want to do. It could be as simple as two text boxes, where the user types into one text box, and the other text box updates with the matching value. You just handle the text box change event in the first text box.

Alternatively, if you want to display the entire dictionary (and it''s not too large that that''s not practical), then you could use anything from a simple ListBox to a ListView, or even a grid control.


使用If条件.但是考虑大写和小写时会很长.
use If conditions. But it will be lengthy when considering uppercase and lowercase.


这篇关于我需要在vb中的简单字典的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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