PropertyGrid.ToolbarVisible 속성

정의

도구 모음을 표시할지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 virtual property bool ToolbarVisible { bool get(); void set(bool value); };
public virtual bool ToolbarVisible { get; set; }
member this.ToolbarVisible : bool with get, set
Public Overridable Property ToolbarVisible As Boolean

속성 값

도구 모음이 표시되면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 코드 예제에서는 를 사용 하 여 컨트롤을 PropertyGrid 초기화 하는 방법을 보여 줍니다는 PropertySortToolbarVisible 속성입니다. 또한 이 예제에서는 컨트롤의 Visible 속성을 로 false 설정 PropertyGrid 하여 예제를 실행할 때 그리드가 표시되지 않도록 합니다. 이 예제를 실행하려면 폼에 다음 코드를 붙여넣고 폼의 생성자 또는 Load 이벤트 처리 메서드에서 메서드를 호출 InitializePropertyGrid 합니다. 폼이 실행 중일 때 속성 표를 보려면 그리드의 Visible 속성을 로 true변경하고 양식을 다시 컴파일하고 다시 실행합니다.

   // Declare a propertyGrid.
internal:
   PropertyGrid^ propertyGrid1;

private:

   // Initialize propertyGrid1.
   [PermissionSetAttribute(SecurityAction::Demand, Name="FullTrust")]
   void InitializePropertyGrid()
   {
      propertyGrid1 = gcnew PropertyGrid;
      propertyGrid1->Name = "PropertyGrid1";
      propertyGrid1->Location = System::Drawing::Point( 185, 20 );
      propertyGrid1->Size = 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 );
   }

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

'Declare a propertyGrid.
Friend WithEvents propertyGrid1 As PropertyGrid

'Initialize propertyGrid1.
Private Sub InitializePropertyGrid()
    propertyGrid1 = New PropertyGrid
    propertyGrid1.Name = "PropertyGrid1"
    propertyGrid1.Location = New 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
    Me.Controls.Add(propertyGrid1)

End Sub

적용 대상