Link to home
Start Free TrialLog in
Avatar of andreas_rafn
andreas_rafnFlag for Denmark

asked on

How to avoid part of node text not being visible in TreeView control in VB.NET (see picture)?

I'm experiencing a weird visual behavior of Windows.Forms.TreeView controls that I haven't managed to avoid yet. Some of the text of root nodes are not showing. I have attached a screendump to show what I'm experiencing.
TreeViewAbnormality.PNG
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

have you overwritten the paint event?

can you reproduce this behavior in another project in which the treeview would have all the default values?
Avatar of andreas_rafn

ASKER

Haven't overwritten the Paint event, and couldn't reproduce the problem in a new project.
However I tried to change fonts back to defaults and that solved the problem. It is kind of annoying though, that one has to use stanmdard fonts for the TreeView to behave properly.
Intuitively it seems that the size of the root node is set to the size that would have been appropriate for a node with the default font (Microsoft Sans Serif, 8 pt, Regular). Is there any way to make sure the size of nodes follows the size/style of the chosen font??
Do you change font at runtime? I think changing it works at design time.
ASKER CERTIFIED SOLUTION
Avatar of andreas_rafn
andreas_rafn
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ended up simply using the default font for the TreeView control, as it, regretfully,  seems to be the only one working properly.