vb中怎样让listview控键的checkbox被选中时该行的记录会在指定的textbox中显示呢?

解决方案 »

  1.   

    有一个sub 好像是checked,如果没有就写在click里面
      

  2.   

    Private Sub ListView1_ItemCheck(ByVal Item As MSComctlLib.ListItem)
    Debug.Print Item.Checked
    text1.text=item.text
    End Sub
      

  3.   

    ListView1_ItemCheck事件的代码能多一点吗,谢谢喽!!!
      

  4.   

    Private   Sub   ListView1_ItemCheck(ByVal   Item   As   MSComctlLib.ListItem) 
    if Item.Checked =true
    text1.text=item.text 
    end if
    End   Sub 
      

  5.   

    Private Sub lsv_ItemCheck(ByVal Item As MSComctlLib.ListItem)
    If Item.Checked = True Then
        
        txtname1.text=Item.text    
        '或                                    '这两项可以根据需要选择
        txtname2.text=Item.SubItems(2)
        ......
    End IfEnd Sub
      

  6.   

            For i = 0 To Me.ListView1.Items.Count - 1
                If ListView1.Items(i).Checked = False Then
                    Me.TextBox1.Text = Me.ListView1.Items(i).SubItems(0).Text
                    Me.TextBox2.Text = Me.ListView1.Items(i).SubItems(1).Text
                    sjbm = Me.ListView1.Items(i).SubItems(2).Text
                End If
    我是这样作的