You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Visual Studio下Windows Form的TextBox NVDA自定义朗读设置

解决NVDA读取TextBox自定义音频反馈的问题

Hey there! Since you're new to Visual Studio and building an app for visually impaired users, let's get that TextBox announcement sorted out. The fix varies a bit based on which UI framework you're using—here are the most common scenarios to cover your bases:

WinForms

  • The easiest way is to use the AccessibleName and AccessibleDescription properties:
    1. In the Visual Studio designer, select your TextBox.
    2. In the Properties window, find AccessibleName and set it to your custom label (e.g., "用户邮箱输入框"). This replaces the default "Edit" part.
    3. Optionally, set AccessibleDescription to add extra context (e.g., "请输入您用于登录的邮箱地址").
  • If you prefer setting it via code:
// Replace "yourTextBox" with your actual TextBox control name
yourTextBox.AccessibleName = "用户邮箱输入框";
yourTextBox.AccessibleDescription = "请输入您用于登录的邮箱地址";

When NVDA focuses the TextBox, it'll announce something like "用户邮箱输入框 - 空白" plus the description if you added it.

WPF

  • WPF uses automation properties to control screen reader announcements. You can set these in XAML or code:

XAML Approach

<TextBox 
    x:Name="shippingAddressTextBox"
    AutomationProperties.Name="收货地址输入框"
    AutomationProperties.HelpText="请输入您的详细收货地址,包括街道、门牌号"/>

Code Approach

AutomationProperties.SetName(shippingAddressTextBox, "收货地址输入框");
AutomationProperties.SetHelpText(shippingAddressTextBox, "请输入您的详细收货地址,包括街道、门牌号");

NVDA will prioritize the AutomationProperties.Name value over the default "Edit" label, then add the state (like "Blank") and help text.

UWP/WinUI 3

  • Similar to WPF, use AutomationProperties.Name and AutomationProperties.HelpText:

XAML Example

<TextBox 
    x:Name="verificationCodeTextBox"
    AutomationProperties.Name="验证码输入框"
    AutomationProperties.HelpText="请输入短信中收到的6位数字验证码"/>

Code Example

AutomationProperties.SetName(verificationCodeTextBox, "验证码输入框");
AutomationProperties.SetHelpText(verificationCodeTextBox, "请输入短信中收到的6位数字验证码");

Quick Tips

  • Make sure you're using the latest version of NVDA—older versions might have limited support for some accessibility properties.
  • Keep your custom text clear and concise: focus on what the field is for, not overly technical details, to help visually impaired users navigate smoothly.

内容的提问来源于stack exchange,提问作者Nidhin Radh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 06:54:58