c# - How can I get the full size of a Tree View in Windows Forms? -
i don't have "autosize" option in treeview, need know what's full height , full width object taking. can define size of treeview panel, shows scrollbar when content overlaps referred size.
is there way know how big content displayed?
thank you
if want know absolute bottom of content area (only what's expanded), can use nodes property bounds property visible height.
treenode tn = tv.nodes[tv.nodes.count - 1]; while(tn.isexpanded) tn = tn.nodes[tn.nodes.count - 1]; return tn.bounds.bottom;
just sure have proper error checking (treeview has nodes, etc). width, can't remember how did it. however, might able use treeview's bounds property (might require testing). had similar situation, didn't have autosizing treeview, contained in panel , fill docked, needed handle scrollbars myself resizing treeview on expand/collapse.
Comments
Post a Comment