Radio button "arrow order" cannot be configured
See original GitHub issueProblem description
When I add multiple RadioButton controls to a form, they are navigated between as a group using the arrow keys instead of the Tab key. (Only the focused radio button in a group has TabStop=true
.) However, the order in which the controls are added to this “arrow order” array appears to depend on the order with which they were added to the form in the InitializeComponent()
method. Since the order of calls in this method cannot be manually changed (without being immediately reverted by the designer), I cannot set the “arrow order” myself. In my project, the runtime “arrow order” happens to be bottom-to-top (pressing the up arrow moves the focus to the next radio button below the currently focused button), but I believe that is due to sheer random chance. It could just as well be in a meaningless, seemingly random order.
I need a way to ensure that the “arrow order” is logically related to the visual position of the controls on the form. I don’t know what this should look like in terms of API, as (a) the ordering of a group of radio buttons needs to be independent of any other group of radio buttons on the form, and (b) this logic appears to be performed by native code, not by Windows Forms proper.
Have you experienced this same bug with .NET Framework? Have not checked, as .NET Framework is EOL.
Version info
.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829
Runtime Environment:
OS Name: Windows
OS Version: 10.0.20262
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100\
Host (useful for support):
Version: 5.0.0
Commit: cf258a14b7
.NET SDKs installed:
3.0.100 [C:\Program Files\dotnet\sdk]
5.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
@merriemcgaw, this sounds familiar maybe because of #2164 but it doesn’t relate to this issue.
Controls
property of a form in the accessibility tree.TabStop
doesn’t affect the order of the arrow keysTabIndex
property? As I see,TabIndex
values affect the order of moving using the arrow keys. For example:Or just set these values using Designer
The control order also determines the display order (which is important for overlapping controls) and is very much editable. You should be able to change the control order by “move to front” / “move to back” actions in the designer, or through the document outline view. If these no longer work thats a defect in the new designer. (I’ve not had a chance to use the new .NET 5 designer yet so I don’t know the state here.)