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. Set the Font of Tree Control

Set the Font of Tree Control

Scheduled Pinned Locked Moved C / C++ / MFC
data-structurestutorial
3 Posts 3 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.
  • B Offline
    B Offline
    brucewayn
    wrote on last edited by
    #1

    Please let me how to change the font of parent node and also how to make it BOLD in tree control. Thanks in Advance

    I M 2 Replies Last reply
    0
    • B brucewayn

      Please let me how to change the font of parent node and also how to make it BOLD in tree control. Thanks in Advance

      I Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      There is no TVM_SETITEMFONT message, and TVITEM has no font member - so you're going to have to roll your sleeves and do it yourself. Or, there are plenty of articles on codeproject to do with owner draw tree controls. It's a shame, though - I'd think font is quite a good extension to a tree view item properties. But it's not up to me! Good luck, Iain.

      1 Reply Last reply
      0
      • B brucewayn

        Please let me how to change the font of parent node and also how to make it BOLD in tree control. Thanks in Advance

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        You can change the font with custom draw. Handle NM_CUSTOMDRAW and select a new font into the DC that you get with the message. Bolding an item is built-in, set the TVIS_BOLD style on the node (or you can just select a bold font when you handle NM_CUSTOMDRAW).

        --Mike-- Visual C++ MVP :cool: LINKS~! CP SearchBar v3.0 | C++ Forum FAQ "That's what's great about doing user interface work. No matter what you do, people will say that what you did was idiotic." -- Raymond Chen

        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