Results 1 to 4 of 4

Thread: listview column header

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    How do i put one of those column headers in a listview control, like in Outlook Express, that sorts the column contents??
    I know how to sort, so u don't need to write out all of that stuff...

  2. #2
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    set the View property to 3, then goto the custom properties screen. goto the column headers tab and add the correct header names, when you run it, it'll work!


    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    those two steps arn't working, is there something i'm skipping??


  4. #4
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ok

    try this in your list view columnclick event
    assuming the name of your list view is lstView
    the following will toggle the sorting in ascending/descending order

    Private Sub lstView_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
    With lstView
    .SortKey = ColumnHeader.Index - 1
    If .SortOrder = lvwAscending Then
    .SortOrder = lvwDescending
    Else
    .SortOrder = lvwAscending
    End If

    .Sorted = True
    End With

    End Sub


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