|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to resize a TreeNode after changing its font?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 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. Show quoteHide quote "Fabio Cannizzo" <fcannizzo.mifft2***@london.edu> wrote in message news:NXQ3e.4325$Br.1180@newsfe2-win.ntli.net... >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 > > 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 Show quoteHide quote "Stephany Young" <noone@localhost> wrote in message news:%23C1e4XEOFHA.2132@TK2MSFTNGP14.phx.gbl... > 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. > > > "Fabio Cannizzo" <fcannizzo.mifft2***@london.edu> wrote in message > news:NXQ3e.4325$Br.1180@newsfe2-win.ntli.net... >>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 >> >> > >
Other interesting topics
Defining Static Members in an Interface
Overriding Inherited Propeties namespace problem can you create a function handling dif objs w/o overloading? Casting derived pass delegate to a function in a dll file Garbage collection (Urgent issue) C# Reflecion - Is it possible? C# Newbie Question. Making button as a link, open in attached WebB SMTP authentication |
|||||||||||||||||||||||