End Google Ads 201810 - BS.net 01 --> I wrote a very cool custom Treeview that has a small problem.

In the overrided OnDrawNode(...) function i draw the nodes with a new bounds.Width which i get from using Graphics.MeasureString on the nodes text. This is better then using the supplied bounds.Width because the default is just plain sloppy. Actually their was a reason for this madness. Some node text's would cause the treeview to just plain not draw all of the Nodes text. I believe this node text can cause that effect in any ********form treeview "Node0 ", where only about half of that text would be visible in the node. So yes by using MeasureString and doing a full custom node drawing i get around the problem of actually drawing the nodes text, but their remains another problem.

If that weird node is the longest node in the Nodes collection... then the treeview would still consider it to have some strange short size then the custom width i used to draw the node text. Therefore the horizontal scrollbar will have an incorrect maximum where you cannot scroll to the rightmost edge of that longest node.

The problem could potentially occur on any node where my drawing is longer then the expected bounds of that node. It's just more noticeable on this particular node because theirs a full half inch that the scrollbar doesnt let you see on the rightmost side.

Is their anyway to override how the treeview calculates the bounds of the nodes? If not then is their a way to force the scrollbar's maximum?