ListView复选框 [英] ListView CheckBox

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

问题描述

大家好,

我有一个将项目列表绑定到其上的listview控件,每个列表项目在其前面都有一个复选框,现在我想更新与之关联的复选框已选中的任何列表项目.

Hello All,

I have a listview control with list of items bind onto it, each list items has checkbox in front of them, now i want to update any list item which the checkbox associated with it is checked.

Thanks in advance!

推荐答案

您的意思是这样的吗?
You mean something like this?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        
        Dim v As Integer
line1:
        For v = 0 To ListView1.Items.Count - 1
            If ListView1.Items(v).Checked = False Then
                ListView1.Items.RemoveAt(v)
                GoTo line1
            End If
        Next v
        
        ListView1.Update()

    End Sub


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

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