TreeView Bold Work Around Help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • casmang

    #1

    TreeView Bold Work Around Help

    I am having the problem where when I change the font of a TreeNode in a
    TreeView to a bold property, the bounds or rectangle that draws the node does
    not expand so that the text ends up being cut off as shown in the attached
    image. I have read all sorts of suggestions about making all the font bold
    first, then changing it back to regular which seems to work, but is sort of a
    crappy solution. My question: Is there any way to just override the drawing
    size or the fill rectangle of the selection box manually in order to not have
    the cut off letters? I tried looking into DrawItems but that does not seem to
    work for a TreeView.

    I am still new at changing how controls draw, so please be gentle
  • Carlos J. Quintero [VB MVP]

    #2
    Re: TreeView Bold Work Around Help

    See if this article that I wrote helps:

    Custom Draw TreeView in VB.NET


    --

    Best regards,

    Carlos J. Quintero

    MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
    You can code, design and document much faster.
    Free resources for add-in developers:
    MZ-Tools has a single goal: To make your everyday programming life easier. As an add-in to several Integrated Development Environment (IDEs) from Microsoft, MZ-Tools adds new menus and toolbars to them that provide many new productivity features.


    "casmang" <casmang@discus sions.microsoft .com> escribió en el mensaje
    news:BFA3364A-C6DB-4CD7-8CDA-4C8D45D7A0C3@mi crosoft.com...[color=blue]
    >I am having the problem where when I change the font of a TreeNode in a
    > TreeView to a bold property, the bounds or rectangle that draws the node
    > does
    > not expand so that the text ends up being cut off as shown in the attached
    > image. I have read all sorts of suggestions about making all the font bold
    > first, then changing it back to regular which seems to work, but is sort
    > of a
    > crappy solution. My question: Is there any way to just override the
    > drawing
    > size or the fill rectangle of the selection box manually in order to not
    > have
    > the cut off letters? I tried looking into DrawItems but that does not seem
    > to
    > work for a TreeView.
    >
    > I am still new at changing how controls draw, so please be gentle[/color]


    Comment

    • Robin Tucker

      #3
      Re: TreeView Bold Work Around Help

      Superb.

      Not sure how I missed this before.

      Thanks.


      "Carlos J. Quintero [VB MVP]" <carlosq@NOSPAM sogecable.com> wrote in message
      news:ugT1RWquFH A.1560@TK2MSFTN GP09.phx.gbl...[color=blue]
      > See if this article that I wrote helps:
      >
      > Custom Draw TreeView in VB.NET
      > http://www.codeproject.com/vb/net/Cu...awTreeview.asp
      >
      > --
      >
      > Best regards,
      >
      > Carlos J. Quintero
      >
      > MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
      > You can code, design and document much faster.
      > Free resources for add-in developers:
      > http://www.mztools.com
      >
      > "casmang" <casmang@discus sions.microsoft .com> escribió en el mensaje
      > news:BFA3364A-C6DB-4CD7-8CDA-4C8D45D7A0C3@mi crosoft.com...[color=green]
      >>I am having the problem where when I change the font of a TreeNode in a
      >> TreeView to a bold property, the bounds or rectangle that draws the node
      >> does
      >> not expand so that the text ends up being cut off as shown in the
      >> attached
      >> image. I have read all sorts of suggestions about making all the font
      >> bold
      >> first, then changing it back to regular which seems to work, but is sort
      >> of a
      >> crappy solution. My question: Is there any way to just override the
      >> drawing
      >> size or the fill rectangle of the selection box manually in order to not
      >> have
      >> the cut off letters? I tried looking into DrawItems but that does not
      >> seem to
      >> work for a TreeView.
      >>
      >> I am still new at changing how controls draw, so please be gentle[/color]
      >
      >[/color]


      Comment

      Working...