Results 1 to 40 of 4215

Thread: CommonControls (Replacement of the MS common controls)

Threaded View

  1. #11
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: CommonControls (Replacement of the MS common controls)

    Bug Report: ListView, whether listitems exist or not
    - when listview is shown and has 2+ column headers, remove all but one
    - re-add 1 or 2 column headers
    - Subscript out of Range error

    I think the control is trying to redraw somewhere between the column header being added, but the header not being appended to the collection yet.

    Updated: I don't know if this was the right thing to do or not, but solved the problem...
    Class: lvwColumnHeaders
    Method: Add
    Action: moved the "ShadowListView.FColumnHeadersAdd" call to end of method

    -----------------------------------------------------------------------------------------------

    Have an option for you. Not just reporting bugs!

    Been playing with your ListView and found something lacking . I noticed you added several types of sorting options, but didn't include the one I was looking for... Explorer-like sorting when text & numeric listitems are intermixed. Suggestion follows.
    Code:
    Private Declare Function StrCmpLogicalW Lib "shlwapi" (ByVal psz1 As Long, ByVal psz2 As Long) As Long
    
    Private Function ListItemsSortingFunctionLogical(ByVal lParam1 As Long, ByVal lParam2 As Long) As Long
        Dim Text1 As String, Text2 As String
        Text1 = Me.FListItemText(lParam1 + 1, PropSortKey)
        Text2 = Me.FListItemText(lParam2 + 1, PropSortKey)
        ListItemsSortingFunctionLogical = StrCmpLogicalW(StrPtr(Text1), StrPtr(Text2))
        If PropSortOrder = LvwSortOrderDescending Then ListItemsSortingFunctionLogical = -ListItemsSortingFunctionLogical
    End Function
    edited: sample of differences, logical compare on the left side
    2string 20string
    3string 2string
    20string 3string
    st2ring st20ring
    st3ring st2ring
    st20ring st3ring
    string2 string2
    string3 string20
    string20 string3
    Last edited by LaVolpe; May 16th, 2020 at 06:52 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

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