windowsforms-devexpress-dot-accessibility-dot-dxaccessible-dot-queryaccessibleinfoeventargs-dot-getdxaccessible-1.md
Returns a BaseAccessible object (or its descendant) that stores additional accessibility information about the currently processed UI element.
Namespace : DevExpress.Accessibility
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
[EditorBrowsable(EditorBrowsableState.Advanced)]
public T GetDXAccessible<T>()
where T : BaseAccessible
<EditorBrowsable(EditorBrowsableState.Advanced)>
Public Function GetDXAccessible(Of T As BaseAccessible) As T
| Name | Description |
|---|---|
| T |
The BaseAccessible class descendant.
|
| Type |
|---|
| T |
DevExpress controls store accessibility information for their UI elements in BaseAccessible class objects (and their descendants). The GetDXAccessible method allows you to access this object and retrieve additional information about the UI element from this object.
The following example handles the QueryAccessibleInfo event to modify the default value of the AccessibleName setting for cells in DevExpress grid controls. The new value is formed as a column’s caption followed by the “cell” word.
using DevExpress.Accessibility;
using static DevExpress.XtraGrid.Accessibility.GridViewAccessibleObject.GridViewDataPanel;
public Form1() {
InitializeComponent();
DXAccessible.QueryAccessibleInfo += DXAccessible_QueryAccessibleInfo;
}
private void DXAccessible_QueryAccessibleInfo(object sender, DXAccessible.QueryAccessibleInfoEventArgs e) {
if (e.Role == AccessibleRole.Cell) {
GridCellAccessibleObject cellAccessible = e.GetDXAccessible<GridCellAccessibleObject>();
if (cellAccessible != null) {
e.Name = cellAccessible.Column.Caption + " cell";
}
}
}
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AddHandler DXAccessible.QueryAccessibleInfo, AddressOf DXAccessible_QueryAccessibleInfo
End Sub
Private Sub DXAccessible_QueryAccessibleInfo(sender As Object, e As DXAccessible.QueryAccessibleInfoEventArgs)
If e.Role = AccessibleRole.Cell Then
Dim cellAccessible As GridCellAccessibleObject = e.GetDXAccessible(Of GridCellAccessibleObject)()
If cellAccessible IsNot Nothing Then
e.Name = cellAccessible.Column.Caption & " cell"
End If
End If
End Sub
See Also
DXAccessible.QueryAccessibleInfoEventArgs Class