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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to define size for CTreeView's branches

How to define size for CTreeView's branches

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

    I'v deefined my own font for CTreeView, but have one problem. Not all words displays in tree branches. I mean, when I enter text in tree branche "Some text", in CTreeView it displays as "Some t". So, I want to determine size in chars for tree branche to display all words completely. Thanks in advance, bilas.

    F 1 Reply Last reply
    0
    • B bilas

      I'v deefined my own font for CTreeView, but have one problem. Not all words displays in tree branches. I mean, when I enter text in tree branche "Some text", in CTreeView it displays as "Some t". So, I want to determine size in chars for tree branche to display all words completely. Thanks in advance, bilas.

      F Offline
      F Offline
      Fred D
      wrote on last edited by
      #2

      make sure you've defined a TVINSERTSTRUCT struct like here.. TVINSERTSTRUCT tvis = { 0 }; tvis.item.mask = **TVIF_TEXT** | TVIF_CHILDREN; tvis.item.cChildren = 1; tvis.item.pszText = "name"; tvis.item.cchTextMax = **lstrlen(tvis.item.pszText)**;

      B 1 Reply Last reply
      0
      • F Fred D

        make sure you've defined a TVINSERTSTRUCT struct like here.. TVINSERTSTRUCT tvis = { 0 }; tvis.item.mask = **TVIF_TEXT** | TVIF_CHILDREN; tvis.item.cChildren = 1; tvis.item.pszText = "name"; tvis.item.cchTextMax = **lstrlen(tvis.item.pszText)**;

        B Offline
        B Offline
        bilas
        wrote on last edited by
        #3

        Yeah, you are rigt. But I need to set cchTextMax every time, when branche is renamed. I'll try again. Anyway, thanks a lot, bilas.

        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