Question CheckedListBox to ListView

janu

Member
Joined
Jan 6, 2012
Messages
16
Programming Experience
Beginner
I want ListView instead of CheckedListBox

files in checkedListBox is being updated via ListBox1

How can I add the size of file too in listview

VB.NET:
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ListBox1.SelectedIndexChanged
         ChecKedListBox.BeginUpdate()
         ChecKedListBoxI.tems.Clear()
            Dim flag As Boolean = ListBox1.SelectedItem Is Nothing
            If Not flag Then
                [B]ChecKedListBox[/B].Items.AddRange(DirectCast(ListBox1.SelectedItem, [Variant]).files)
            End If
            ChecKedListBox.EndUpdate()
            
        End Sub

when I use ListView instead of CheckedListBox I get this error
whereas CareSuite is a web refrence
VB.NET:
Overload resolution failed because no accessible 'AddRange' can be called with these arguments:
    'Public Sub AddRange(items As System.Windows.Forms.ListView.ListViewItemCollection)': Value of type '1-dimensional array of WindowsApplication1.CareSuite.File' cannot be converted to 'System.Windows.Forms.ListView.ListViewItemCollection'.
    'Public Sub AddRange(items() As System.Windows.Forms.ListViewItem)': Value of type '1-dimensional array of WindowsApplication1.CareSuite.File' cannot be converted to '1-dimensional array of System.Windows.Forms.ListViewItem' because 'WindowsApplication1.CareSuite.File' is not derived from 'System.Windows.Forms.ListViewItem'.
 
Back
Top