本文整理汇总了C#中System.Windows.Forms.TreeView.HideSelection属性的典型用法代码示例。如果您正苦于以下问题:C# TreeView.HideSelection属性的具体用法?C# TreeView.HideSelection怎么用?C# TreeView.HideSelection使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Windows.Forms.TreeView
的用法示例。
在下文中一共展示了TreeView.HideSelection属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeSelectedTreeView
// Declare the TreeView control.
internal System.Windows.Forms.TreeView TreeView2;
// Initialize the TreeView to blend with the form, giving it the
// same color as the form and no border.
private void InitializeSelectedTreeView()
{
// Create a new TreeView control and set the location and size.
this.TreeView2 = new System.Windows.Forms.TreeView();
this.TreeView2.Location = new System.Drawing.Point(72, 48);
this.TreeView2.Size = new System.Drawing.Size(200, 200);
this.TreeView2.BorderStyle = BorderStyle.Fixed3D;
// Set the HideSelection property to false to keep the
// selection highlighted when the user leaves the control.
// This helps it blend with form.
this.TreeView2.HideSelection = false;
// Add the nodes.
this.TreeView2.Nodes.AddRange(new TreeNode[]
{new TreeNode("Features",
new TreeNode[]{
new TreeNode("Full Color"),
new TreeNode("Project Wizards"),
new TreeNode("Visual C# and Visual Basic Support")}),
new TreeNode("System Requirements",
new TreeNode[]{
new TreeNode("Pentium 133 MHz or faster processor "),
new TreeNode("Windows 98 or later"),
new TreeNode("100 MB Disk space")})
});
// Set the tab index and add the TreeView to the form.
this.TreeView2.TabIndex = 0;
this.Controls.Add(this.TreeView2);
}