简体   繁体   中英

For accessibility (a11y) we need access to TextBlock items with the keyboard (Tab). How can we manage that?

For our project we need to make an UWP application and it must be accessible for blind people. But we have a problem with static texts.

TextBlock is not derived from Control, so it's not Focusable. We tried to wrap it within a ContentControl, but that doesn't work either.

        <ContentControl
            x:Name="textBlock"
            Grid.Row="1"
            Margin="24,0,0,24"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            IsFocusEngagementEnabled="True"
            IsTabStop="True"
            TabIndex="20">
            <TextBlock IsTextSelectionEnabled="True" TextWrapping="Wrap">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa.           
           </TextBlock>
        </ContentControl>

How can we get static text into the accessibility tree so the user can navigate to it with the keyboard and can hear the text?

When you use the arrow keys when holding de Caps Lock or Insert Button the text items are accessible and Narrator is reading the text.

So problem solved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM