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 / March 2006

Tip: Looking for answers? Try searching our database.

Changing the TreeNode NodeFont to a bold font chops of text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeroen-bart Engelen - 06 Mar 2006 03:18 GMT
Hello,

I have a TreeView filled with nodes and then later on I wish to change
some node labels to a bold font. When I do this, the lenght of the
label gets longer, the boldness takes up more space, but instead of
showing al the text, the text gets cut off at a certain point. It seems
like the new bold text cannot be longer then the longest regular text.

Does anyone have an idea how to fix this?

Thanks,
Jeroen-bart Engelen
Claes Bergefall - 06 Mar 2006 15:14 GMT
From the docs for TreeNode.NodeFont:
"If the node font is larger than the Font property value set in the TreeView
control, the tree node label text is clipped."

Solution is to reverse your thinking. Set the entire tree to use a bold font
and then change the nodes you don't want bold.

   /claes

> Hello,
>
[quoted text clipped - 8 lines]
> Thanks,
> Jeroen-bart Engelen
Jeroen-bart Engelen - 06 Mar 2006 16:21 GMT
> From the docs for TreeNode.NodeFont:
> "If the node font is larger than the Font property value set in the TreeView
> control, the tree node label text is clipped."
>
> Solution is to reverse your thinking. Set the entire tree to use a bold font
> and then change the nodes you don't want bold.

Thanks. I set it to bold and it fitted perfectly. Too perfect actually,
so I added an additional space at the end of the string when I set it
to bold. And now it even looks great! :-)

Jeroen-bart Engelen

Rate this thread:







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.