Control.ControlAccessibleObject 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
접근성 애플리케이션에서 사용할 수 있는 컨트롤에 대한 정보를 제공합니다.
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
- 상속
- 상속
- 파생
- 특성
예제
다음 코드 예제에서는 클래스에서 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) |