TreeView text truncated

G

Guest

Using .net 2.0 and C# I have a TreeView in which I put some nodes with rather
long text. The problem is that some times the text gets truncated and other
times the horizontal scrollbar appears but doesn't allow the control to
scroll all the way to the end of the text.
 
F

FUnky

Are you adding items to the treeview using the designer ? If yes, do them
via code to remove the unwanted scrollbar.

The text gets truncated probably if u r changing the font attributes (bold
etc) after adding the item. First set the font to bold and then add its
text.

FUnky
 
G

Guest

Are you adding items to the treeview using the designer ? If yes, do them
via code to remove the unwanted scrollbar.

The text gets truncated probably if u r changing the font attributes (bold
etc) after adding the item. First set the font to bold and then add its
text.

I'm adding them with code and not setting bold. I set the forecolor, before
adding it to the tree's node collection. I was instantiating the TreeNode by
providing the text to the constructor, and now I've tried the parameterless
constructor and setting the Text after setting the ForeColor, but the same
problem exists.

And I'm using BeginUpdate and EndUpdate.

And don't get me wrong, I want both scrollbars as appropriate, but shouldn't
the horizontal scrollbar be able to scroll all the way the end of the text?
Bearing in mind that I accept that a TreeView / TreeNode may have a practical
limit on text length. But such limit should be documented somewhere and
shouldn't an exception be thrown when it's exceeded?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top