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

適用対象