Results 1 to 21 of 21

Thread: [RESOLVED] ListView Bolded Items Font Size/Style cannot be changed

Threaded View

  1. #1

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Resolved [RESOLVED] ListView Bolded Items Font Size/Style cannot be changed

    I'm playing with per-monitor awareness and trying to get VB's Common Controls ocx v6 compatible. Request below is for a non-subclassing approach.

    With the listivew, about the only thing I haven't figured out how to manipulate is the Bold property on the control's Font and/or .ListSubItems Font objects. When .Bold is set to True, then any changes to the font size due to DPI changes are ignored.

    It seems that the ocx creates a Bold font object exactly once, first time an item's .Bold property is set to true and does not recreate it when a new font (size, name, etc) is assigned. You can test this easily enough with any v6 listview
    - Add a couple list items
    - Ensure one has its .Bold property set to true
    - At runtime, change the listview's Font size to 1.5x
    - Each unbolded item will resize. If you change the font name, the bolded item does not change either.

    Anyone know of a workaround to get the bolded items using the same font as non-bolded items?
    - I've tried unbolding every item before changing the font and rebolding afterwards -- no change
    - I've tried using SendMessage WM_SETFONT -- no change
    - I've tried toggling the View property -- no change
    - I've tried removing every bold item, changing font, & reinserting items while making bold -- no change
    - I've even tried to completely clear the listview (headers & listitems) -- no change
    Note: Simply toggling the .Bold property results in expected font when not-bolded and reverting to cached font when bolded. Those items not previously bolded change to cached font when bolded.

    Granted that the v6 of the ocx is outdated, but this is the only option, so far, that I have not been able to get per-monitor DPI aware.
    Last edited by LaVolpe; Nov 9th, 2019 at 02:22 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