Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. e.DrawDefault = true;
  2. currentWith_ = Math.Max(currentWith_, e.Node.Bounds.Right);
  3.  
  4. private void treeViewAfterExpand(object sender, TreeViewEventArgs e)
  5. {
  6. int maxRight = treeView.ClientSize.Widht;
  7.  
  8. if(e.Node.Nodes != null)
  9. foreach (TreeNode node in e.Node.Nodes)
  10. {
  11. maxRight = Math.Max(maxRight, node.Bounds.Right);
  12. }
  13.  
  14. treeView.ClientSize = new Size(maxRight, treeView.ClientSize.Height);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement