如何选择列表视图只是一个项目 [英] How to select just one item from listview

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

问题描述

与使用复选框列表视图

的ListView

checkbox id

001
002
003
...

我希望每次只选择一个ID,我要在MessageBox显示所选项目

I want to select only one id at a time, and i want to show a selected item in the messagebox

例如:

001 ID进行检查,如果我检查 002 ID自动意味着 001 ID检查应该删除,并显示一个消息框002选择了

001 id is checked, if i check 002 id means automatically 001 id check should remove, and display a messagebox "002 is Selected"

推荐答案

如果你使用一个列表框,默认行为是在一个时间只能选择一个项目。您可以通过设置或清除 .MultiSelect 属性更改这种行为。

If you use a ListBox, the default behaviour is for only one item to be selected at a time. You can change that behaviour by setting or clearing the .MultiSelect property.

这里是你可能会发现有用的教程。

Here is a tutorial you may find helpful.

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

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