大网数据广告活动
安装更新与部署

Adding Extra Text to Radio Buttons

· 52CE 我爱测

Screen reader programs can only read the text of a RadioButtonGroup control that has been authored into the Text column of the RadioButton table.

Screen reader programs can only read the text of a RadioButtonGroup control that has been authored into the Text column of the RadioButton table. If this text is an insufficient description of the radio buttons, overlapping Text controls can be added to provide extra descriptive text. These Text controls should overlap each other in the dialog box and have conditions set in the ControlCondition table so that only one Text control is shown at a time. The Text controls must not overlap the RadioButtonGroup control or other controls in the dialog because this makes the controls invisible to screen readers. When the user hovers the cursor over the Text control, the screen reader program reads the extra text.

In the following example the MySample dialog box has a RadioButtonGroup control named Colors with two choices for the value of the TheColor property. For each choice there is a Text control with a condition to hide or show, depending on the current choice selected for TheColor. An initial TheColor value is defined in the Property table. The Text controls have the extra descriptive text authored in the Text field of the RadioButton table. When a user hovers the cursor over the Text control in the dialog box, the screen reader can read the extra description of the current choice.

Dialog table

Dialog HCentering VCentering Width Height Attributes Title Control_First Control_Default Control_Cancel
MySample 50 50 200 180 3 Accessible radio buttons Colors Next

Control table

Dialog_ Control Type X Y Width Height Attributes Property Text Control_Next Help
MySample Colors RadioButtonGroup 2 20 100 50 3 TheColor Next
MySample HowIsBlue Text 20 80 150 15 2 It is like the sky on a clear day.
MySample HowIsGreen Text 20 80 150 15 2 It is like grass in the spring.

RadioButton table

Property Order Value X Y Width Height Text Help
TheColor 1 Blue 10 10 80 15 &Blue
TheColor 2 Green 10 30 80 15 &Green

Property table

Property Value
TheColor Blue

ControlCondition table

Dialog_ Control_ Action Condition
MySample HowIsBlue Hide TheColor <> "Blue"
MySample HowIsBlue Show TheColor = "Blue"
MySample HowIsGreen Hide TheColor <> "Green"
MySample HowIsGreen Show TheColor = "Green"

For more information, see Accessibility.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。