Binding.PropertyName 속성

정의

컨트롤의 데이터 바인딩된 속성의 이름을 가져옵니다.

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

속성 값

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 목록에 바인딩할 컨트롤 속성을 지정하는 데 사용합니다. 가장 일반적으로 컨트롤의 속성과 같은 Text 표시 속성을 바인딩합니다 TextBox . 그러나 컨트롤의 속성을 바인딩할 수 있으므로 데이터베이스의 데이터를 사용하여 런타임에 프로그래밍 방식으로 컨트롤을 만들 수 있습니다.

적용 대상