Results 1 to 6 of 6

Thread: [RESOLVED] Treeview Text not showing correct

  1. #1

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Resolved [RESOLVED] Treeview Text not showing correct

    Hi just ran into an odd problum with treeview node text I add a top node and I wanted it's text in bold. The bold works fine but half the text is missing

    Here an example
    vbnet Code:
    1. Dim sFont As New Font("Verdana", 8, FontStyle.Bold)
    2. Tv1.Nodes.Add("TOP", "0123456789", 0, 0)

    The code above for me only shows 012345678 and not showing the 9 any ideas if I use regular style it works fine only happens when I apply the bold style.

  2. #2
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    340

    Re: Treeview Text not showing correct

    Did you limit the amount of characters that can be entered for the textbox.

    Check the textbox properties.

  3. #3

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Re: Treeview Text not showing correct

    Quote Originally Posted by Ritzky View Post
    Did you limit the amount of characters that can be entered for the textbox.

    Check the textbox properties.
    Sorry should of said label it the lable that not showing text right well it showing but it skiping chars

    Ok I uploaded an image of the problum


    This is the code as you can see it skips most of the label out
    Code:
    Tv1.Nodes.Add("TOP", "This is a long string", 0, 0)

  4. #4

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Re: Treeview Text not showing correct

    Still haveing problums with this node label any ideas, I even tryed chnageing the font and it still only shows half of what ment to be in the label. this is the code I am using I am missing somerthing out

    vbnet Code:
    1. Dim sFont As New Font("system", 8, FontStyle.Bold)
    2. Tv1.Nodes(0).NodeFont = sFont
    3. when adding this parent node
    4. Tv1.Nodes.Add("TOP", "Clips123456789abcdef", 0, 0)

    result of the label will be Clips123456789abc choping of the rest of the chars any ideas thanks.

  5. #5
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Treeview Text not showing correct

    Take a look here.

    Apparently the issue can be solved by setting the Font property on the TreeView to a bold font, instead of setting it on the individual TreeViewNodes.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  6. #6

    Thread Starter
    Fanatic Member BenJones's Avatar
    Join Date
    Mar 2010
    Location
    Wales UK
    Posts
    814

    Re: Treeview Text not showing correct

    Thanks Atheist that link was usfull now fixed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width