473,322 Members | 1,501 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,322 software developers and data experts.

TreeNode Label

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?

Thanks in advance!
Nov 20 '05 #1
10 1229
* "Juan Romero" <ju*********@bowne.com> scripsit:
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.....


I am not able to repro that, even with very long texts.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Here is the code to reproduce it:

Dim oNode As New TreeNode
oNode.ImageIndex = 3
oNode.SelectedImageIndex = 3
oNode.NodeFont = New Font("Tahoma", 8, FontStyle.Bold)
oNode.Text = "Control Panel"
tvMenus.Nodes.Add(oNode)
tvMenus.Refresh()

Thank you for your help. I appreciate it.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:br************@ID-208219.news.uni-berlin.de...
* "Juan Romero" <ju*********@bowne.com> scripsit:
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.....


I am not able to repro that, even with very long texts.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
Cor
Hi Herfried,

This has been more here, it is not the long text but the font seems to get
to high and the top is cut off, do you know it?

Cor
Nov 20 '05 #4
* "Juan Romero" <ju*********@bowne.com> scripsit:
Here is the code to reproduce it:

Dim oNode As New TreeNode
oNode.ImageIndex = 3
oNode.SelectedImageIndex = 3
oNode.NodeFont = New Font("Tahoma", 8, FontStyle.Bold)
oNode.Text = "Control Panel"
tvMenus.Nodes.Add(oNode)
tvMenus.Refresh()


Set the TreeView's 'Font' property to the bold font too.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5
* "Cor" <no*@non.com> scripsit:
This has been more here, it is not the long text but the font seems to get
to high and the top is cut off, do you know it?


Setting the control's 'Font' property to a large font will fix this
problem, I think.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #6
Cor
I saw your message, .

Nov 20 '05 #7
* "Cor" <no*@non.com> scripsit:
I saw your message, .


Did it work? Is there something missing in your message?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
Cor
:-)))
Did it work? Is there something missing in your message?

Nov 20 '05 #9
* "Cor" <no*@non.com> scripsit:
:-)))


You mossed the ":-)))" or did my newsreader eat it?
Did it work? Is there something missing in your message?


--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
Yes, it did fix it.
Of course this is more of a workaround than a solution. It seems like you
have to set the font to the largest and thickest font you will use on your
treeview, and then create all the nodes, making a new font for them, except
for the one that has the font in question.

Thanks a lot guys.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:br************@ID-208219.news.uni-berlin.de...
* "Cor" <no*@non.com> scripsit:
:-)))


You mossed the ":-)))" or did my newsreader eat it?
Did it work? Is there something missing in your message?


--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #11

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

Similar topics

0
by: Sean | last post by:
Hi, I am doing a desktop application and now I am having problem preventing the quick highlight of a treenode when a user right clicks a treenode. The reason I am doing this is that only when...
2
by: Sean | last post by:
Hi, I have a treeview and user can right click the treenodes, depending on the nodes, different shortcut menu will appear. I want only the shortcut menu to appear if the point of the right...
2
by: Fei Li | last post by:
Why TreeNode is a string? It should hold a Object and get label from Object.ToString(). Then much better. Easy to trace all objects in a TreeView.
4
by: Patrick Noll | last post by:
hi ng, i have a problem when i try to change the text property of a TreeNode just before the user is able to edit this property. Example: // Label before anything happens... TreeNode.Text =...
1
by: MrNobody | last post by:
I was wondering if it was at all possible to make the label of a TreeNode dynamic- calling a specific method or property whenever it needs to obtain a label to draw? The reason is I'd like to...
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...
9
by: vincent90152900 | last post by:
How to pop up different text base on the selected TreeNode? I want to pop up different Text base on the selected TreeNode of the TreeView component. So, I create a TreeView and a ModalPopupExtender....
4
by: Rob Stevens | last post by:
Is there some sort of unique identifier in every treenode that is consistent? I was looking at the handle of every treenode, but it appears that the handle changes everytime the tree is built. ...
4
by: ohad weiss | last post by:
Hi all I have a question abount renaming a selected treenode. My user can place the cursor on a treeview, click on the right button of the mouse, and a contextmenue is beeing populated, in which...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.