Results 1 to 4 of 4

Thread: CheckedListBox to ListView

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    CheckedListBox to ListView

    I have these codes which when selected items in listbox it display files in CheckedListBox ...

    service

    vb.net Code:
    1. Private Sub _service_GetReleaseSodaCompleted(ByVal sender As Object, ByVal e As GetReleaseSodaCompletedEventArgs)
    2.         Dim flag As Boolean = Not e.Cancelled
    3.         If Not flag Then
    4.         Else
    5.             flag = Not InvokeRequired
    6.             If Not flag Then
    7.                 Dim objArr As Object() = New Object() {sender, e}
    8.                 Invoke(New GetReleaseSodaCompletedEventHandler(AddressOf _service_GetReleaseSodaCompleted), objArr)
    9.             Else
    10.                
    11.                 flag = e.[Error] Is Nothing
    12.                 If Not flag Then
    13.                     Dim myDateTime As DateTime = DateTime.Now
    14.                 Else
    15.                     CheckedListBox1.BeginUpdate()
    16.                     CheckedListBox1.Items.AddRange(e.Result)
    17.                     CheckedListBox1.EndUpdate()
    18.                 End If
    19.             End If
    20.         End If
    21.     End Sub

    ListBox1_SelectedIndexChanged


    vb.net Code:
    1. Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
    2.        
    3.         CheckedListBox1.BeginUpdate()
    4.         CheckedListBox1.Items.Clear()
    5.         Dim flag As Boolean = ListBox1.SelectedItem Is Nothing
    6.         If Not flag Then
    7.             CheckedListBox1.Items.AddRange(DirectCast(ListBox1.SelectedItem, [Soda]).files)
    8.         End If
    9.         CheckedListBox1.EndUpdate()      
    10. End Sub

    how can I use ListView instead of CheckedListBox ..so that in ListView I may able to show file name as well as file size

    In ListBox .. this peace of code shows only file name ... how can I declare file size so that I can get file name and file size in ListView
    Code:
    CheckedListBox1.Items.AddRange(DirectCast(ListBox1.SelectedItem, [Soda]).files)

  2. #2
    Hyperactive Member DavesChillaxin's Avatar
    Join Date
    Mar 2011
    Location
    WNY
    Posts
    451

    Re: CheckedListBox to ListView

    Are you asking how to use a Listview control so you can display more information?
    Last edited by DavesChillaxin; Jan 28th, 2012 at 10:08 AM.
    Please rate if my post was helpful!
    Per favore e grazie!




    Code Bank:
    Advanced Algebra Class *Update | True Gradient Label Control *Dev | A Smarter TextBox *Update | Register Global HotKey *Update
    Media Library Beta *Dev | Mouse Tracker (Available in VB.net and C#.net) *New | On-Screen Numpad (VB.net) *New

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: CheckedListBox to ListView

    Quote Originally Posted by DavesChillaxin View Post
    Are you asking how to use a Listview control so you can display more information?
    yes, Obviously !

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: CheckedListBox to ListView

    Sorry! by mistake I made thread title different whereas it is how to use ListView instead of CheckedListBox..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width