Results 1 to 4 of 4

Thread: Is it possible to highlight partial text in a ListView SubItem ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Is it possible to highlight partial text in a ListView SubItem ?

    Hi, just wondered if there was some way of doing this using an API as I can not find any standard Properties to do this.

    I am trying to enhance my ListView display to highlight the actual search text within a longer display string showing 10 characters either side of the found search text.

    I have searched high and low on the web and found several ways of highlighting partial text within other controls using SendMessage, but not within a ListView.

    I am using Visual Basic 6, Service Pack 6.

    Any help would be appreciated.

    Thanks,
    Andy.

  2. #2

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Exclamation Re: Is it possible to highlight partial text in a ListView SubItem ?

    Bump ...

    I take it that after 32 reads and no responses that this can not be done in VB6 !?

    Ah well, would have been a nice feature, but probably aiming too high !

    Thanks anyway,
    Andy.

  3. #3
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Is it possible to highlight partial text in a ListView SubItem ?

    Here is my idea:
    Place control array of textbox over the listsubitems. Copy the text from listsubitem to the textbox and highlight the text in the textbox.

    I've attatched my test project.
    Run it and click "Find&Highlight" button. Then scroll the listview using scrollbar. (tracking scrolling through keyboard shouldn't be hard)

    It still has bug(s). If you keep pressing the scrollbar when the listview scrolled to bottommost, VB crashes.

    But, I hope it will give you the idea.
    Attached Files Attached Files
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Re: Is it possible to highlight partial text in a ListView SubItem ?

    Thanks iPrank, well that's definately one way around it ! I certainly would not have thought of doing it that way !

    Appreciate the sample code as well, you must have spent some time on this.

    Cheers,
    Andy.

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