473,653 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5810
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***********@l ibero.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***********@l ibero.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
1884
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 several of the TreeNodes in the TreeView but now, on those changed nodes, the underline from the HotTracking no longer appears on the screen (but, while being hovered over, the node still gets the HotTracking font color change and the background...
0
1558
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 boldface text truncated with everything after "W" removed. private void Form1_Load(object sender, System.EventArgs e) { TreeNode newNode = new TreeNode("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); treeView1.Nodes.Add(newNode);
2
2392
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 cause this? I just want to be able to use my own node class so that I can store extra data... =========================
2
7360
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 the Bounds rectangle and it is not displayed properly (it is trimmed). Does anybody know how to change the TreeNode.Bounds at runtime?
10
1248
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 only see what fits there. How do I resize this area? I mean, one would expect the label box to resize itself..... Any ideas?
11
4748
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 behavior, if I delete all childnodes, when the parent node is expanted, and rebuild all child treenodes, I can make an childnode bold without clipping it. If I make the same with an closed parent node so after rebulding all childnodes and expanting it,...
1
2719
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, btnCalculate.Font.Style | FontStyle.Bold);
7
43887
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 object. 4. If string size is less than the size of the rectangle, we are done.
2
2744
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 the node doesn't have the room for the bolded text to entirely fit. Is there something I need to do to the node to adjust its width? -- Dennis
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4147
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.