PropertyGrid.PropertySort プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As PropertyGrid Dim value As PropertySort value = instance.PropertySort instance.PropertySort = value
/** @property */ public PropertySort get_PropertySort () /** @property */ public void set_PropertySort (PropertySort value)
public function get PropertySort () : PropertySort public function set PropertySort (value : PropertySort)
PropertySort 値の 1 つ。既定値は PropertySort.Categorized または PropertySort.Alphabetical です。


PropertySort プロパティを設定すると、グリッド上のプロパティの並べ替えボタンの外観が変わり、プロパティの現在の状態が反映されます。PropertySort を PropertySort.NoSort に設定すると、プロパティは取得された順序で表示されます。
PropertySort を、Alphabetical および Categorized の両方に設定することは、PropertySort を Categorized だけに設定することと同じです。カテゴリで分類されたビューは、必ずアルファベット順で表示されます。
![]() |
---|
カスタムの並べ替えを行うには、コンポーネントに ICustomTypeDescriptor を実装して、希望する順序でプロパティを返すようにします。 |

PropertySort プロパティと ToolBarVisible プロパティを使用して PropertyGrid コントロールを初期化する方法を次のコード例に示します。また、この例では、PropertyGrid コントロールの Visible プロパティを false に設定して、例を実行したときにグリッドが表示されないようにしています。この例を実行するには、次のコードをフォームに貼り付けて、フォームのコンストラクタまたは Load のイベント処理メソッドで InitializePropertyGrid メソッドを呼び出します。フォーム実行時にプロパティ グリッドを表示するには、グリッドの Visible プロパティを true に変更し、フォームを再コンパイルして実行します。
// 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. 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 ); }

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からPropertyGrid.PropertySort プロパティを検索する場合は、下記のリンクをクリックしてください。

- PropertyGrid.PropertySort プロパティのページへのリンク