CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Location
    Dublin, Ireland
    Posts
    21

    List views and multiple fonts

    Hello,

    I'm trying to figure out how to get a listview
    control to display listitems with different
    font settings, such as typeface, strikethrough,
    point size, etc.

    An example of where I have seen this working is
    with Microsoft Outlook. The tasks section looks
    like a list view control, but completed tasks
    are displayed in the strikethrough style.

    I've scoured the internet trying to find someone
    who has done this, but so far no joy! Can anyone
    help ?

    Many thanks in advance

    Sean


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: List views and multiple fonts

    If you want to display different fonts for each item in the listview, then you're going to have to get to grips with the CustomDraw notification messages that windows fires at the controls owner (ie. the form). I've written some code for VB5 (should work with the VB6 controls also, but they are a bit crappy). It also means that you're going to have to get your hands dirty with subclassing.

    You can see my code here : http://codeguru.developer.com/vb/art...redItems.shtml

    If that seems way too complicated for what you want to do, I'd recommend that you take a look at the 'S-Grid' component from http://vbaccelerator.com - it's free and has lots of other features (including the ones you want).





    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

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

Featured