473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

TreeNode with BOLD font get truncated

Hi

I noticed that if I use a bold font for 1 TreeNode of a TreeView
several times the string does not fit anymore and gets truncated.

How can I avoid that ?

Any suggestionis appreciated

-P

Sep 18 '06 #1
4 5779
I noticed that if I use a bold font for 1 TreeNode of a TreeView
several times the string does not fit anymore and gets truncated.
Yepp, even says so in the documentation:
"If the node font is larger than the Font property value set in the TreeView
control, the tree node label text is clipped"
(larger in this case means "takes more physical room to display", it's not
related to the font size)
How can I avoid that ?
Make the font for the entire TreeView bold and then unbold the items that
you don't want bold.

/claes
Sep 18 '06 #2
Claes Bergefall ha scritto:
I noticed that if I use a bold font for 1 TreeNode of a TreeView
several times the string does not fit anymore and gets truncated.

Yepp, even says so in the documentation:
"If the node font is larger than the Font property value set in the TreeView
control, the tree node label text is clipped"
(larger in this case means "takes more physical room to display", it's not
related to the font size)
How can I avoid that ?

Make the font for the entire TreeView bold and then unbold the items that
you don't want bold.
Thank you Claes. Very helpful indeed.

(Peccato che there isn't a cleaner solution ! )

-P
>
/claes
Sep 18 '06 #3
On 18 Sep 2006 14:49:49 -0700, pa***********@libero.it wrote:
>Claes Bergefall ha scritto:
I noticed that if I use a bold font for 1 TreeNode of a TreeView
several times the string does not fit anymore and gets truncated.

Yepp, even says so in the documentation:
"If the node font is larger than the Font property value set in the TreeView
control, the tree node label text is clipped"
(larger in this case means "takes more physical room to display", it's not
related to the font size)
How can I avoid that ?

Make the font for the entire TreeView bold and then unbold the items that
you don't want bold.

Thank you Claes. Very helpful indeed.

(Peccato che there isn't a cleaner solution ! )

-P
>>
/claes
After setting a given node text to bold, simply setting the node text again displays
the bold text unclipped.

Gene
Sep 18 '06 #4
gene kelley ha scritto:
On 18 Sep 2006 14:49:49 -0700, pa***********@libero.it wrote:
How can I avoid that ?

Make the font for the entire TreeView bold and then unbold the items that
you don't want bold.
Thank you Claes. Very helpful indeed.

(Peccato che there isn't a cleaner solution ! )

-P
>
/claes

After setting a given node text to bold, simply setting the node text again displays
the bold text unclipped.
Beautiful!

Thanks
Gene
Sep 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: hzgt9b | last post by:
Using VS 2003, VB.NET: I have a TreeView control filled with TreeNodes. When I create the TreeView, I set HotTracking = True. Subsequently, I change the font (make the not bold versus bold) on...
0
by: Jon Davis | last post by:
It looks like (looks like! ... not that there is!) there's a bug in the TreeNode object. When you change the font, it does not readjust its size appropriately. The following code shows the...
2
by: Benny Raymond | last post by:
More problems with this... When I run this code, the main form returns an invalid cast exception as it's executing the line "TreeNode n = (TreeNode) this.Nodes;" Does anyone know what would...
2
by: Fabio Cannizzo | last post by:
I execute the following code: myTreeNode.NodeFont = new Font( ... ); However this does not change the Bounds of the TreeNode and as a result the TreeNode's Text does no longer fit and it in...
10
by: Juan Romero | last post by:
Hey guys, I have been playing with different fonts for the nodes of a treeview. When I change the font to bigger sizes, the text area of the treenode (label) no longer displays all the text. I...
11
by: Mano | last post by:
When settiing a TreeNode to bold the text label of that node is clipped. As describedin in the Bug Rebort FDBK16963 I set the underliying TreeView Fond to be bold. Now I have the strange...
1
by: Henry Jones | last post by:
I found some code to change the font on a button to bold: private void btnBold_Click(object sender, System.EventArgs e) { btnCalculate.Font = new Font(btnCalculate.Font, ...
7
by: carterweb | last post by:
This is how I do it now. 1. Determine the dimensions of the rectangle. 2. Set a my font size to a fixed maximum size. 3. Apply the font my string and measure the string using the graphics...
2
by: Dennis | last post by:
I am using VS 2005. I have a form with a TreeView. I want to change the font of the root node to bold. But when I do, running the program causes the text in that node to appear truncated ... as if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.