选择列表框中的项目 [英] Selection of items in list box

查看:72
本文介绍了选择列表框中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表框现在我想通过VB代码选择3个值


并限制用户选择onle三个值请帮帮我


关注

解决方案

尝试代码

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | Wrap | 行号


当你说:
@maliksleo


你在吗?想要在ListBox中显示3个值吗?

如何向ListBox添加项目?


-Frinny


< blockquote>我认为他说他有一个包含多项选择的列表框。但是想要将它限制在不超过3个。


Maliksleo:如果这听起来是正确的,请使用SelectedIndicesChanged事件,并与已经选择的项目数进行比较。


i have a list box now i want to select 3 values in it through VB code

and restrict the user to select onle three values please help me

Regards

解决方案

Try code

Expand|Select|Wrap|Line Numbers


Could you please elaborate on what you mean when you say:
@maliksleo
Do you only want 3 values to appear in the ListBox?
How are you adding items to your ListBox?

-Frinny


I think he''s saying he has a listbox with multiple selection, of many items. But wants to restrict it to no more than 3.

Maliksleo: If that sounds right use the SelectedIndicesChanged event, and compare to the number of items already selected.


这篇关于选择列表框中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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