How to resize a TreeNode after changing its font?

F

Fabio Cannizzo

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?

Note that I do not want to change the Font property for the all TreeView,
but only for that specific TreeNode.

Thanks
Fabio
 
S

Stephany Young

Do the reverse. Set the font of the TreeView to the bigger font at design
time and at runtime, change the Nodefont of all the other TreeNodes to the
small one.

I knock it's a 'hack' but it works.
 
F

Fabio Cannizzo

Hi Stephanie.

Thanks for your suggestion. Actually I thought about that and if I cannot
find another way I'll go it.
I was hoping there was other solution. May be using the API?

Fabio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top