다음을 통해 공유


PropertyGrid 클래스

개체의 속성을 검색할 수 있는 사용자 인터페이스를 지정합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class PropertyGrid
    Inherits ContainerControl
    Implements IComPropertyBrowser
‘사용 방법
Dim instance As PropertyGrid
[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.Object
   System.MarshalByRefObject
     System.ComponentModel.Component
       System.Windows.Forms.Control
         System.Windows.Forms.ScrollableControl
           System.Windows.Forms.ContainerControl
            System.Windows.Forms.PropertyGrid

스레드로부터의 안전성

이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

플랫폼

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에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

참고 항목

참조

PropertyGrid 멤버
System.Windows.Forms 네임스페이스
PropertyTabScope