Closed HindujaArugula closed 1 year ago
@dmitrii-drobotov @Tanya-Solyanik are we able to get the pane selected? This seems awfully familiar to me, like we've already addressed it at some point.
Yeah, I found these issues: https://github.com/dotnet/winforms/issues/3660 and https://github.com/dotnet/winforms/issues/3678. From what I can tell, it's intended that this pane is not selectable.
@merriemcgaw @dmitrii-drobotov Print preview control had never displayed focus and there is nothing selectable inside the control. The only thing customer might want to do is to scroll up and down to see more pages. Are there any keyboard shortcuts that control scroll bars? Scroll Lock key does not work for me in winforms apps.
Are there any keyboard shortcuts that control scroll bars? Scroll Lock key does not work for me in winforms apps.
Print preview can be scrolled by Ctrl+Arrows, but it needs to have TabStop = true
.
Print preview can be scrolled by Ctrl+Arrows, but it needs to have TabStop = true.
Yeah, I think it was a mistake to remove TabStop there. @merriemcgaw looks like we should add the focus border to print preview
OK, let's get that in.
The content of PrintPreviewControl is drawn in overriden OnPaint
method.
So, the easiest way to add a focus rectangle would be to draw it inside OnPaint
.
But OnPaint
can only draw client area, i.e. it does not include scroll bars.
Focus rectangle around the client area would look like this:
Focus rectangle is drawn inside of PrintPreview, around the gray area. Here is an animation of switching focus:
https://github.com/dotnet/winforms/assets/113603457/4b88d5a3-d330-4285-9a76-7cb0572402d1
Scroll bars in PrintPreview are native, added using WS_HSCROLL and WS_VSCROLL window styles. I see two ways to make focus rectangle include scrollbars:
Reworking control to use .NET scrollbars would change accessibility tree structure, adding ScrollBarAccessibleObject
-s to the tree.
Handling WM_NCPAINT may not be sufficient. For example, when user moves mouse cursor over the scrollbar, the focus rectangle is overdrawn by windows, but WM_NCPAINT message is not sent. Some workaround is needed here, maybe handling MouseMove event and calling RedrawWindow to refresh focus rectangle.
Verified this on .NET 8.0 latest build: 8.0.100-rc.1.23402.12, it was fixed. Now keyboard focus is going to the "View your page" "Pane".
https://github.com/dotnet/winforms/assets/56664234/68733d36-4187-4b8f-9b77-01757e7ebc42
@merriemcgaw @Tanya-Solyanik Could you please provide the latest environment to verify the issue. PendingEnvironment; Regressed:08-16-23;
@Ashley-Li , @Olina-Zhang Could you please help with the current test environment?
Here is the testing app: \\mlangfs1\public\Winforms\CoreTest\AccessibilityTestingApp\CoreApplication\CoreSDK8.0_Test_app\Accessibility_Core_8.0_AppExe.zip and required .Net 8.0 SDK: \\mlangfs1\public\Winforms\CoreTest\AccessibilityTestingApp\CoreApplication\CoreSDK8.0_Test_app\dotnet-sdk-8.0.100-rc.2.23417.14-win-x64.exe
Verified this on .NET 8.0 RC1 test pass build: 8.0.100-rc.1.23421.2, it was fixed, test result is same as above video.
Verified the issue in latest testing app i.e., \mlangfs1\public\Winforms\CoreTest\AccessibilityTestingApp\CoreApplication\CoreSDK8.0_Test_app\Accessibility_Core_8.0_AppExe.zip. Issue is fixed and does not repro. Hence closing the bug. Please find closing attachment.
.NET version
.NET-SDK-8.0.100-preview.4.23260.5
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No response
Issue description
GitHubTags:
A11yMAS;#A11yTCS;#BM_.NET Core[Winforms]-Win32-May2023;#.NET Core;#A11ySev2;#WCAG2.1.1;#DesktopApp;#Win11;#NonBenchmark;#Keyboard;
Actual:
Keyboard focus is not going to the "View your page" "Pane".
Expected:
Keyboard focus should go to the "View your page" "Pane".
User Impact:
Keyboard only users will face difficulties if the keyboard focus does not to the "View your page" pane.
Steps to reproduce
Attachment: