PropertyGrid クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _ <ComVisibleAttribute(True)> _ Public Class PropertyGrid Inherits ContainerControl Implements IComPropertyBrowser
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)] [ComVisibleAttribute(true)] public class PropertyGrid : ContainerControl, IComPropertyBrowser
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)] [ComVisibleAttribute(true)] public ref class PropertyGrid : public ContainerControl, IComPropertyBrowser
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */ /** @attribute ComVisibleAttribute(true) */ public class PropertyGrid extends ContainerControl implements IComPropertyBrowser
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) ComVisibleAttribute(true) public class PropertyGrid extends ContainerControl implements IComPropertyBrowser

プロパティ グリッドを使用するには、親コントロール上で PropertyGrid クラスの新しいインスタンスを作成し、プロパティを表示する対象のオブジェクトを SelectedObject に設定します。
グリッドに表示される情報は、オブジェクトが割り当てられた時点におけるプロパティのスナップショットです。SelectedObject で指定されたオブジェクトのプロパティ値が実行時にコードによって変更されても、グリッドを更新するためのアクションが実行されるまでは、新しい値は表示されません。
プロパティ グリッド内のプロパティ タブは、PropertyGrid の上部にあるツール バーのボタンとして表示され、PropertyTabScope で定義されているスコープで変化します。
開発環境のツールボックスには、初期状態では PropertyGrid コントロールは表示されません。プロパティ グリッドをツールボックスに追加すると、PropertyGrid オブジェクトをフォームにドラッグできるようになります。適切なコードをソース コードに追加して、PropertyGrid のインスタンスを定義することもできます。

プロパティ グリッドを作成し、そのグリッドのフォーム上の位置を設定するコード例を次に示します。このコードでは、TextBox を持つフォームが作成されている必要があります。
public Form1() { // The initial constructor code goes here. PropertyGrid propertyGrid1 = new PropertyGrid(); propertyGrid1.CommandsVisibleIfAvailable = true; propertyGrid1.Location = new Point(10, 20); propertyGrid1.Size = new System.Drawing.Size(400, 300); propertyGrid1.TabIndex = 1; propertyGrid1.Text = "Property Grid"; this.Controls.Add(propertyGrid1); propertyGrid1.SelectedObject = textBox1; }
public: [PermissionSetAttribute(SecurityAction::Demand, Name="FullTrust")] Form1() { // The initial constructor code goes here. PropertyGrid^ propertyGrid1 = gcnew PropertyGrid; propertyGrid1->CommandsVisibleIfAvailable = true; propertyGrid1->Location = Point( 10, 20 ); propertyGrid1->Size = System::Drawing::Size( 400, 300 ); propertyGrid1->TabIndex = 1; propertyGrid1->Text = "Property Grid"; this->Controls->Add( propertyGrid1 ); propertyGrid1->SelectedObject = textBox1; }

System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.PropertyGrid


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- PropertyGrid クラスのページへのリンク