Binding.PropertyName プロパティ

定義

コントロールのデータ バインドされたプロパティの名前を取得します。

public:
 property System::String ^ PropertyName { System::String ^ get(); };
public string PropertyName { get; }
member this.PropertyName : string
Public ReadOnly Property PropertyName As String

プロパティ値

バインド先のコントロール プロパティの名前。

次のコード例では、 PropertyName フォーム上の各コントロールのそれぞれの Binding 値を出力します。

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()
{
   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 Sub PrintPropertyNameAndIsBinding
    Dim thisControl As Control
    Dim thisBinding As Binding
    For Each thisControl In Me.Controls
        For Each thisBinding In thisControl.DataBindings
            Console.WriteLine(ControlChars.CrLf & thisControl.ToString)
            ' Print the PropertyName value for each binding.
            Console.WriteLine(thisBinding.PropertyName)
        Next
    Next
End Sub

注釈

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

適用対象