Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Changing row Font in listctrl, changes width but not height

Changing row Font in listctrl, changes width but not height

Scheduled Pinned Locked Moved C / C++ / MFC
helpalgorithms
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ScorpioMidget
    wrote on last edited by
    #1

    I have a listctrl where i can set any row to use a new font, the main problem i had was that on changing the font the rows/columns would not resize correctly to take account of the new text extents. After searching on this site and then looking on MSDN, i now send a CCM_SETVERSION 5 message to the listctrl before i add any items. This now makes the column widths resize correctly, but the row heights are still wrong. I've spent many hours trying to find a way to fix this but have made no progress. Hoping you can give me some ideas. BTW it's a NW_CUSTOMDRAW listctrl not an ownerdraw. ScorpioMidget

    J 1 Reply Last reply
    0
    • S ScorpioMidget

      I have a listctrl where i can set any row to use a new font, the main problem i had was that on changing the font the rows/columns would not resize correctly to take account of the new text extents. After searching on this site and then looking on MSDN, i now send a CCM_SETVERSION 5 message to the listctrl before i add any items. This now makes the column widths resize correctly, but the row heights are still wrong. I've spent many hours trying to find a way to fix this but have made no progress. Hoping you can give me some ideas. BTW it's a NW_CUSTOMDRAW listctrl not an ownerdraw. ScorpioMidget

      J Offline
      J Offline
      Joan M
      wrote on last edited by
      #2

      If you can't get it to work, create an imagelist without images and then assing that imagelist to your listctrl, the rows will have the Images height... I suppose that you will be able to readapt the heights as you want using this trick... Hope this helps...

      https://www.robotecnik.com freelance robots, PLC and CNC programmer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups