PropertyGrid.ToolbarVisible Propiedad

Definición

Obtiene o establece un valor que indica si está visible la barra de herramientas.

C#
public virtual bool ToolbarVisible { get; set; }

Valor de propiedad

Es true si está visible la barra de herramientas; en caso contrario, es false. De manera predeterminada, es true.

Ejemplos

En el ejemplo de código siguiente se muestra cómo inicializar un PropertyGrid control mediante las PropertySortpropiedades , ToolbarVisible . Además, en este ejemplo se establece la PropertyGrid propiedad del Visible control en false , por lo que la cuadrícula no será visible cuando se ejecute el ejemplo. Para ejecutar este ejemplo, pegue el código siguiente en un formulario y llame al InitializePropertyGrid método desde el constructor Load o el método de control de eventos del formulario. Para ver la cuadrícula de propiedades cuando se ejecuta el formulario, cambie la propiedad de Visible la cuadrícula a , vuelva a compilar y vuelva a trueejecutar el formulario.

C#

// Declare a propertyGrid.
internal PropertyGrid propertyGrid1;

// Initialize propertyGrid1.
private void InitializePropertyGrid()
{
    propertyGrid1 = new PropertyGrid();
    propertyGrid1.Name = "PropertyGrid1";
    propertyGrid1.Location = new System.Drawing.Point(185, 20);
    propertyGrid1.Size = new System.Drawing.Size(150, 300);
    propertyGrid1.TabIndex = 5;

    // Set the sort to alphabetical and set Toolbar visible
    // to false, so the user cannot change the sort.
    propertyGrid1.PropertySort = PropertySort.Alphabetical;
    propertyGrid1.ToolbarVisible = false;
    propertyGrid1.Text = "Property Grid";

    // Add the PropertyGrid to the form, but set its
    // visibility to False so it will not appear when the form loads.
    propertyGrid1.Visible = false;
    this.Controls.Add(propertyGrid1);
}

Se aplica a

Produto Versións
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9