Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

TreeView text truncated

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
PIEBALD - 12 Jul 2006 20:23 GMT
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.
FUnky - 13 Jul 2006 11:28 GMT
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
PIEBALD - 13 Jul 2006 15:35 GMT
> 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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.