|
-
Nov 9th, 2019, 02:06 PM
#1
[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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|