Accessibility control issue on textbox

jaejun lee 0 Reputation points
2023-04-13T11:14:20.66+00:00

I set the audio guide string for screen reader(accessibility) to text box and text block component, But Narrator only reads "no item in view". Which properties should I set for textbox or textblock?

<Grid>
                                <TextBlock IsHitTestVisible="False" FontSize="13" Name="AddTitle" AutomationProperties.Name="{x:Static p:Resources.AddTitle}" Text="{x:Static p:Resources.AddTitle}" Padding="0" Margin="8"  Height="32" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#313c6c" Opacity="0.5" Width="150"  Visibility="{Binding Text.IsEmpty,ElementName=Title, Converter={StaticResource BooleanToVisibilityConverter}}" FontFamily="{Binding Source={x:Static glob:CultureInfo.CurrentCulture}, Converter={StaticResource TextBlockFontFamilyConverter}, ConverterCulture={x:Static glob:CultureInfo.CurrentCulture}, ConverterParameter='3'}"/>
                                <TextBox x:Name="Title" Height="32" Width="390" Margin="0,0,0,16" AutomationProperties.LabeledBy="{Binding ElementName=AddTitle}" AutomationProperties.Name="{x:Static p:Resources.AddTitle}" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left"  Style="{StaticResource WaterMarkTextBox}"/>

XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
790 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 43,046 Reputation points Microsoft Vendor
    2023-04-13T12:35:45.84+00:00

    Hi @jaejun lee ,Welcome to Q&A.

    From what I've tested, you can't use IsHitTestVisible="False" which makes it unreadable.

      <TextBox x:Name="textBox1" AutomationProperties.Name="jack" />
    

    Here is an example for AutomationProperties.Name.

    This is the official documentation for AutomationProperties.

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.