HideSelection Propiedad
Este artículo se tradujo automáticamente. Para ver el artículo en inglés, active la casilla Inglés. Además, puede mostrar el texto en inglés en una ventana emergente si mueve el puntero del mouse sobre el texto.
Traducción
Inglés

TreeView.HideSelection (Propiedad)

 

Obtiene o establece un valor que indica si el nodo de árbol seleccionado permanece resaltado aun cuando la vista de árbol pierda el foco.

Espacio de nombres:   System.Windows.Forms
Ensamblado:  System.Windows.Forms (en System.Windows.Forms.dll)

public bool HideSelection { get; set; }

Valor de propiedad

Type: System.Boolean

Es true si el nodo de árbol seleccionado no está resaltado cuando la vista de árbol ha perdido el foco; en caso contrario, es false.De manera predeterminada, es true.

When this property is set to false, selected nodes in the TreeView control remain highlighted in a different color than the current selection color when the TreeView control loses focus.You can use this property to keep items that are selected by the user visible when the user clicks a different control on the form or moves to a different window.

System_CAPS_noteNota

If you are concerned with the accessibility of your applications, it is recommended that you set the HideSelection property to false.

The following code example demonstrates how to use the HideSelection property.To run this example, paste the following code in a form and call the InitializeSelectedTreeView method in the form's constructor or Load event handler.


// 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);
}

.NET Framework
Disponible desde 1.1
Volver al principio
Mostrar:
© 2016 Microsoft