다음을 통해 공유


Control.ControlAccessibleObject 클래스

정의

접근성 애플리케이션에서 사용할 수 있는 컨트롤에 대한 정보를 제공합니다.

public: ref class Control::ControlAccessibleObject : System::Windows::Forms::AccessibleObject
[System.Runtime.InteropServices.ComVisible(true)]
public class Control.ControlAccessibleObject : System.Windows.Forms.AccessibleObject
public class Control.ControlAccessibleObject : System.Windows.Forms.AccessibleObject
[<System.Runtime.InteropServices.ComVisible(true)>]
type Control.ControlAccessibleObject = class
    inherit AccessibleObject
type Control.ControlAccessibleObject = class
    inherit AccessibleObject
Public Class Control.ControlAccessibleObject
Inherits AccessibleObject
상속
Control.ControlAccessibleObject
상속
파생
특성

예제

다음 코드 예제에서는 클래스에서 CheckBox 파생 되는 확인란 컨트롤을 만들고 사용할 파생된 클래스에 대 한 사용자 지정 Control.ControlAccessibleObject 을 만듭니다. 파생 클래스 MyCheckBoxAppearanceButton 는 기본적으로 토글 단추로 표시되도록 합니다. 파생 Control.ControlAccessibleObject 클래스 MyCheckBoxControlAccessibleObject는 모양 차이를 고려하여 세 가지 속성을 재정의합니다.

#using <Accessibility.dll>
#using <System.Drawing.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>

using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;

namespace MyCustomControls
{
   public ref class MyCheckBox: public CheckBox
   {
   public:
      MyCheckBox()
      {
         // Make the check box appear like a toggle button.
         this->Appearance = ::Appearance::Button;

         // Center the text on the button.
         this->TextAlign = ContentAlignment::MiddleCenter;

         // Set the AccessibleDescription text.
         this->AccessibleDescription = "A toggle style button.";
      }

   protected:

      // Create an instance of the AccessibleObject
      // defined for the 'MyCheckBox' control
      virtual AccessibleObject^ CreateAccessibilityInstance() override;
   };

   // Accessible Object* for use with the 'MyCheckBox' control.
   private ref class MyCheckBoxAccessibleObject: public Control::ControlAccessibleObject
   {
   public:
      MyCheckBoxAccessibleObject( MyCheckBox^ owner )
         : ControlAccessibleObject( owner )
      {}

      property String^ DefaultAction 
      {
         virtual String^ get() override
         {
            // Return the DefaultAction based upon
            // the state of the control.
            if ( (dynamic_cast<MyCheckBox^>(Owner))->Checked )
            {
               return "Toggle button up";
            }
            else
            {
               return "Toggle button down";
            }
         }
      }

      property String^ Name 
      {
         virtual String^ get() override
         {
            // Return the Text property of the control
            // if the AccessibleName is 0.
            String^ name = Owner->AccessibleName;
            if ( name != nullptr )
            {
               return name;
            }

            return (dynamic_cast<MyCheckBox^>(Owner))->Text;
         }

         virtual void set( String^ value ) override
         {
            ControlAccessibleObject::Name = value;
         }
      }

      property AccessibleRole Role 
      {
         virtual AccessibleRole get() override
         {
            // Since the check box appears like a button,
            // make the Role the same as a button.
            return AccessibleRole::PushButton;
         }
      }
   };

   AccessibleObject^ MyCheckBox::CreateAccessibilityInstance()
   {
      return gcnew MyCheckBoxAccessibleObject( this );
   }
}
using System;
using System.Windows.Forms;
using Accessibility;
using System.Drawing;

namespace MyCustomControls
{
   public class MyCheckBox : CheckBox
   {
      public MyCheckBox()
      {
         // Make the check box appear like a toggle button.
         this.Appearance = Appearance.Button;
         // Center the text on the button.
         this.TextAlign = ContentAlignment.MiddleCenter;
         // Set the AccessibleDescription text.
         this.AccessibleDescription = "A toggle style button.";
      }
      
      // Create an instance of the AccessibleObject 
      // defined for the 'MyCheckBox' control
      protected override AccessibleObject CreateAccessibilityInstance() 
      {
         return new MyCheckBoxAccessibleObject(this);
      }
   }

   // Accessible object for use with the 'MyCheckBox' control.
   internal class MyCheckBoxAccessibleObject : Control.ControlAccessibleObject 
   {
      public MyCheckBoxAccessibleObject(MyCheckBox owner) : base(owner) 
      {
      }
               
      public override string DefaultAction 
      {
         get
         {
            // Return the DefaultAction based upon 
            // the state of the control.
            if( ((MyCheckBox)Owner).Checked )
            {
               return "Toggle button up";
            }
            else
            {
               return "Toggle button down";
            }
         }
      }

      public override string Name 
      {
         get 
         {
            // Return the Text property of the control 
            // if the AccessibleName is null.
            string name = Owner.AccessibleName;
            if (name != null) 
            {
               return name;
            }
            return ((MyCheckBox)Owner).Text;
         }
         
         set
         {
            base.Name = value;
         }
      }            
               
      public override AccessibleRole Role 
      {
         get 
         {
            // Since the check box appears like a button,
            // make the Role the same as a button.
            return AccessibleRole.PushButton;
         }
      }
   }
}
Imports System.Windows.Forms
Imports Accessibility
Imports System.Drawing

Namespace MyCustomControls
   Public Class MyCheckBox
      Inherits CheckBox
      
      Public Sub New()
         ' Make the check box appear like a toggle button.
         Me.Appearance = Appearance.Button
         ' Center the text on the button.
         Me.TextAlign = ContentAlignment.MiddleCenter
      End Sub
      
      ' Create an instance of the AccessibleObject 
      ' defined for the 'MyCheckBox' control 
      Protected Overrides Function CreateAccessibilityInstance() _
        As AccessibleObject
         Return New MyCheckBoxAccessibleObject(Me)
      End Function
   End Class
    
   ' Accessible object for use with the 'MyCheckBox' control.
   Friend Class MyCheckBoxAccessibleObject
      Inherits Control.ControlAccessibleObject
      
      Public Sub New(owner As MyCheckBox)
         MyBase.New(owner)
      End Sub
      
      Public Overrides ReadOnly Property DefaultAction() As String
         Get
            ' Return the DefaultAction based upon 
            ' the state of the control. 
            If CType(Owner, MyCheckBox).Checked Then
               Return "Toggle button up"
            Else
               Return "Toggle button down"
            End If
         End Get
      End Property
      
      Public Overrides Property Name() As String
         Get
            ' Return the Text property of the control 
            ' if the AccessibleName is null. 
            Dim accessibleName As String = Owner.AccessibleName
            If (accessibleName IsNot Nothing) Then
               Return accessibleName
            End If
            Return CType(Owner, MyCheckBox).Text
         End Get

         Set
            MyBase.Name = value
         End Set
      End Property
      
      Public Overrides ReadOnly Property Role() As AccessibleRole
         Get
            ' Since the check box appears like a button,
            ' make the Role the same as a button. 
            Return AccessibleRole.PushButton
         End Get
      End Property
   End Class
End Namespace

설명

Windows Forms에는 접근성 지원이 기본 제공되어 있으며, 접근성 클라이언트 애플리케이션에서 작동할 수 있도록 하는 애플리케이션에 대한 정보를 제공합니다. 접근성 클라이언트 애플리케이션의 예로는 화면 확대 및 검토자 유틸리티, 음성 입력 유틸리티, 화상 키보드, 대체 입력 장치 및 키보드 향상 유틸리티가 있습니다. 경우에 따라 접근성 클라이언트 애플리케이션에 추가 정보를 제공하려고 합니다. 이 추가 정보를 제공하는 방법에는 두 가지가 있습니다. 기존 컨트롤에 대해 제한된 접근성 정보를 제공하려면 액세스 가능성 클라이언트 애플리케이션에 보고될 컨트롤AccessibleNameAccessibleDescriptionAccessibleDefaultActionDescription, 속성 AccessibleRole 값을 설정합니다. 또는 컨트롤에 더 많은 접근성 정보를 포함해야 하는 경우 또는 Control.ControlAccessibleObject 클래스에서 AccessibleObject 파생된 고유한 클래스를 작성할 수 있습니다. 예를 들어 공통 컨트롤에서 파생되지 않은 고유한 컨트롤을 작성하거나 컨트롤 내에서 적중 테스트와 같은 작업이 필요한 경우 메서드를 Control.ControlAccessibleObject 호출 CreateAccessibilityInstance 하여 컨트롤에 대한 컨트롤을 만들어야 합니다.

메모

메서드를 재정의하는 AccessibleObject.GetChild 경우 메서드도 재정의 AccessibleObject.GetChildCount 해야 합니다. 속성을 얻거나 설정 AccessibilityObject 하려면 .NET Framework와 함께 설치된 어셈블리에 Accessibility 대한 참조를 추가해야 합니다.

액세스 가능한 개체에 대한 자세한 내용은 Microsoft Active Accessibility를 참조하세요.

생성자

Name Description
Control.ControlAccessibleObject(Control)

Control.ControlAccessibleObject 클래스의 새 인스턴스를 초기화합니다.

속성

Name Description
Bounds

액세스 가능한 개체의 위치와 크기를 가져옵니다.

(다음에서 상속됨 AccessibleObject)
DefaultAction

개체의 기본 동작을 설명하는 문자열을 가져옵니다. 모든 개체에 기본 동작이 있는 것은 아닙니다.

Description

에 대한 Control.ControlAccessibleObject설명을 가져옵니다.

Handle

액세스 가능한 개체의 핸들을 가져오거나 설정합니다.

Help

개체가 수행하는 기능 또는 개체의 사용 방법에 대한 설명을 가져옵니다.

KeyboardShortcut

액세스 가능한 개체에 대한 개체 바로 가기 키 또는 액세스 키를 가져옵니다.

Name

액세스 가능한 개체 이름을 가져오거나 설정합니다.

Owner

액세스 가능한 개체의 소유자를 가져옵니다.

Parent

액세스 가능한 개체의 부모를 가져옵니다.

Role

이 액세스 가능한 개체의 역할을 가져옵니다.

State

이 액세스 가능한 개체의 상태를 가져옵니다.

(다음에서 상속됨 AccessibleObject)
Value

액세스 가능한 개체의 값을 가져오거나 설정합니다.

(다음에서 상속됨 AccessibleObject)

메서드

Name Description
CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시를 생성하는 데 필요한 모든 관련 정보를 포함하는 개체를 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
DoDefaultAction()

이 액세스 가능한 개체와 연결된 기본 작업을 수행합니다.

(다음에서 상속됨 AccessibleObject)
Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetChild(Int32)

지정된 인덱스에 해당하는 액세스 가능한 자식 값을 검색합니다.

(다음에서 상속됨 AccessibleObject)
GetChildCount()

액세스 가능한 개체에 속하는 자식 수를 검색합니다.

(다음에서 상속됨 AccessibleObject)
GetFocused()

키보드 포커스가 있는 개체를 검색합니다.

(다음에서 상속됨 AccessibleObject)
GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetHelpTopic(String)

도움말 항목의 식별자 및 이 액세스 가능한 개체와 연결된 도움말 파일의 경로를 가져옵니다.

GetLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 현재 수명 서비스 개체를 검색합니다.

(다음에서 상속됨 MarshalByRefObject)
GetSelected()

현재 선택한 자식 값을 검색합니다.

(다음에서 상속됨 AccessibleObject)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
HitTest(Int32, Int32)

지정된 화면 좌표에서 자식 개체를 검색합니다.

(다음에서 상속됨 AccessibleObject)
InitializeLifetimeService()
사용되지 않음.

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.

(다음에서 상속됨 MarshalByRefObject)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.

(다음에서 상속됨 MarshalByRefObject)
Navigate(AccessibleNavigation)

액세스 가능한 다른 개체로 이동합니다.

(다음에서 상속됨 AccessibleObject)
NotifyClients(AccessibleEvents, Int32, Int32)

지정된 자식 컨트롤에 대해 지정된 AccessibleEvents 액세스 가능성 클라이언트 애플리케이션에 알리고 식별을 AccessibleObject제공합니다.

NotifyClients(AccessibleEvents, Int32)

지정한 자식 컨트롤에 대해 지정된 AccessibleEvents 액세스 가능성 클라이언트 애플리케이션에 알릴 수 있습니다.

NotifyClients(AccessibleEvents)

지정 AccessibleEvents한 액세스 가능성 클라이언트 애플리케이션에 알 줍니다.

RaiseAutomationNotification(AutomationNotificationKind, AutomationNotificationProcessing, String)

UI 자동화 알림 이벤트를 발생합니다.

(다음에서 상속됨 AccessibleObject)
RaiseLiveRegionChanged()

LiveRegionChanged UI 자동화 이벤트를 발생합니다.

Select(AccessibleSelection)

선택 영역을 수정하거나 접근성 있는 개체의 키보드 포커스를 이동합니다.

(다음에서 상속됨 AccessibleObject)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

UseStdAccessibleObjects(IntPtr, Int32)

개체를 개체의 AccessibleObject 핸들 및 개체 ID를 기반으로 하는 인스턴스와 연결합니다.

(다음에서 상속됨 AccessibleObject)
UseStdAccessibleObjects(IntPtr)

개체의 핸들을 기반으로 개체의 AccessibleObject 인스턴스와 개체를 연결합니다.

(다음에서 상속됨 AccessibleObject)

명시적 인터페이스 구현

Name Description
IAccessible.accChildCount

이 개체에 속하는 자식 인터페이스의 수를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 accChildCount.

(다음에서 상속됨 AccessibleObject)
IAccessible.accDoDefaultAction(Object)

지정된 개체의 기본 동작을 수행합니다. 모든 개체에 기본 동작이 있는 것은 아닙니다. 이 멤버에 대한 설명은 을 참조하세요 accDoDefaultAction(Object).

(다음에서 상속됨 AccessibleObject)
IAccessible.accFocus

키보드 포커스가 있는 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 accFocus.

(다음에서 상속됨 AccessibleObject)
IAccessible.accHitTest(Int32, Int32)

지정된 화면 좌표에서 자식 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 accHitTest(Int32, Int32).

(다음에서 상속됨 AccessibleObject)
IAccessible.accLocation(Int32, Int32, Int32, Int32, Object)

개체의 현재 화면 위치를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 accLocation(Int32, Int32, Int32, Int32, Object).

(다음에서 상속됨 AccessibleObject)
IAccessible.accNavigate(Int32, Object)

현재 개체를 기준으로 액세스할 수 있는 개체로 이동합니다. 이 멤버에 대한 설명은 을 참조하세요 accNavigate(Int32, Object).

(다음에서 상속됨 AccessibleObject)
IAccessible.accParent

이 개체의 부모 액세스 가능 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 accParent.

(다음에서 상속됨 AccessibleObject)
IAccessible.accSelect(Int32, Object)

선택 영역을 수정하거나 접근성 있는 개체의 키보드 포커스를 이동합니다. 이 멤버에 대한 설명은 을 참조하세요 accSelect(Int32, Object).

(다음에서 상속됨 AccessibleObject)
IAccessible.accSelection

액세스 가능한 개체의 선택한 자식 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 accSelection.

(다음에서 상속됨 AccessibleObject)
IReflect.GetField(String, BindingFlags)

FieldInfo 지정된 필드 및 바인딩 플래그에 해당하는 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetField(String, BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetFields(BindingFlags)

현재 클래스의 FieldInfo 모든 필드에 해당하는 개체의 배열을 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetFields(BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetMember(String, BindingFlags)

모든 공용 멤버 또는 지정된 이름과 일치하는 모든 멤버에 해당하는 개체의 배열 MemberInfo 을 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetMember(String, BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetMembers(BindingFlags)

모든 공용 멤버 또는 현재 클래스의 MemberInfo 모든 멤버에 해당하는 개체의 배열을 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetMembers(BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

MethodInfo 형식 배열을 사용하여 오버로드된 메서드 중에서 선택할 수 있는 지정된 메서드에 해당하는 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]).

(다음에서 상속됨 AccessibleObject)
IReflect.GetMethod(String, BindingFlags)

MethodInfo 지정된 검색 제약 조건 하에서 지정된 메서드에 해당하는 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetMethod(String, BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetMethods(BindingFlags)

모든 public 메서드 또는 현재 클래스의 MethodInfo 모든 메서드가 있는 개체의 배열을 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetMethods(BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetProperties(BindingFlags)

모든 공용 속성 또는 현재 클래스의 PropertyInfo 모든 속성에 해당하는 개체의 배열을 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetProperties(BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

PropertyInfo 지정된 검색 제약 조건이 있는 지정된 속성에 해당하는 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]).

(다음에서 상속됨 AccessibleObject)
IReflect.GetProperty(String, BindingFlags)

PropertyInfo 지정된 검색 제약 조건 하에서 지정된 속성에 해당하는 개체를 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 GetProperty(String, BindingFlags).

(다음에서 상속됨 AccessibleObject)
IReflect.InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])

지정된 멤버를 호출합니다. 이 멤버에 대한 설명은 을 참조하세요 InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]).

(다음에서 상속됨 AccessibleObject)
IReflect.UnderlyingSystemType

개체를 나타내는 기본 형식을 IReflect 가져옵니다. 이 멤버에 대한 설명은 을 참조하세요 UnderlyingSystemType.

(다음에서 상속됨 AccessibleObject)

적용 대상

추가 정보