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


PropertyName を使用して、データ ソースのリストにバインドするコントロール プロパティを指定します。通常は、TextBox コントロールの Text プロパティなどの表示プロパティをバインドします。ただし、コントロールの任意のプロパティをバインドできるため、データベースのデータを使用するコントロールを実行時にプログラムによって作成できます。

フォーム上の各コントロールについて、それぞれの Binding の PropertyName 値を出力するコード例を次に示します。
private void PrintPropertyNameAndIsBinding() { foreach(Control thisControl in this.Controls) { foreach(Binding thisBinding in thisControl.DataBindings) { Console.WriteLine("\n" + thisControl.ToString()); // Print the PropertyName value for each binding. Console.WriteLine(thisBinding.PropertyName); } } }
private: void PrintPropertyNameAndIsBinding() { for each ( Control^ thisControl in this->Controls) { for each ( Binding^ thisBinding in thisControl->DataBindings ) { Console::WriteLine( "\n {0}", thisControl ); // Print the PropertyName value for each binding. Console::WriteLine( thisBinding->PropertyName ); } } }
private void PrintPropertyNameAndIsBinding() { for (int iCtr1 = 0; iCtr1 < this.get_Controls().get_Count(); iCtr1++) { Control thisControl = this.get_Controls().get_Item(iCtr1); for (int iCtr2 = 0; iCtr2 < thisControl.get_DataBindings().get_Count(); iCtr2++) { Binding thisBinding = thisControl.get_DataBindings().get_Item(iCtr2); Console.WriteLine(("\n" + thisControl.ToString())); // Print the PropertyName value for each binding. Console.WriteLine(thisBinding.get_PropertyName()); } } } //PrintPropertyNameAndIsBinding
private function PrintPropertyNameAndIsBinding() { for(var thisControl : Control in this.Controls) { for(var thisBinding : Binding in thisControl.DataBindings) { Console.WriteLine("\n" + thisControl.ToString()); // Print the PropertyName value for each binding. Console.WriteLine(thisBinding.PropertyName); } } }

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


- Binding.PropertyName プロパティのページへのリンク