Sfoglia il codice sorgente

* TreeView.cs: Set the top node to the last child node when
expanding all
- When we get focus, if there is no selected node, use the top
node.


svn path=/trunk/mcs/; revision=77651

Jackson Harper 18 anni fa
parent
commit
2eb4d510de

+ 7 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,10 @@
+2007-05-18  Jackson Harper  <[email protected]>
+
+	* TreeView.cs: Set the top node to the last child node when
+	expanding all
+	- When we get focus, if there is no selected node, use the top
+	node.
+
 2007-05-18  Jonathan Pobst  <[email protected]>
 
 	* KeysConverter.cs: Add CanConvertTo.

+ 2 - 3
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeView.cs

@@ -722,7 +722,7 @@ namespace System.Windows.Forms {
 			} else {
 				RecalculateVisibleOrder (root_node);
 				UpdateScrollBars (true);
-				vbar.Value = vbar.Maximum;
+				SetTop (Nodes [Nodes.Count - 1]);
 			}
 		}
 
@@ -1831,8 +1831,7 @@ namespace System.Windows.Forms {
 					return;
 				}
 #if NET_2_0
-				if (Nodes.Count > 1)
-					SelectedNode = Nodes [Nodes.Count - 1];
+				SelectedNode = TopNode;
 #else
 				if (Nodes.Count > 1)
 					SelectedNode = Nodes [0];