Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[A11Y] Expose ClientSize property for forms #12183

Open
towebo opened this issue Sep 19, 2024 · 2 comments
Open

[A11Y] Expose ClientSize property for forms #12183

towebo opened this issue Sep 19, 2024 · 2 comments
Assignees
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues

Comments

@towebo
Copy link

towebo commented Sep 19, 2024

Environment

VisualStudio.17.Preview/17.11.0-pre.5.0+35118.90

.NET version

8.0

Did this work in a previous version of Visual Studio and/or previous .NET release?

No

Issue description

When you're blind or have very limited vision it's very hard to determine the suitable with for the form.
With the ClientSize property you can easily calculate a suitable width by adding the left and width for the right most control and adding the distance you've used for the left margin.

Steps to reproduce

  1. Create a new WinForms application and open the form.
  2. Add a textbox to the form and set it's Left and Top to 12 and its width to 200.
  3. Calculate the suitable form width by adding the textbox Left and Width and adding its Left once more: 12 + 200 + 12 = 224
  4. Set the form width to 224.

Not quite right.

Diagnostics

No response

@towebo towebo added the untriaged The team needs to look at this issue in the next triage label Sep 19, 2024
@Tanya-Solyanik Tanya-Solyanik added the area-VSDesigner Windows Forms out-of-proc designer related issues label Sep 24, 2024
@merriemcgaw
Copy link
Member

@towebo - is your goal to be able to calculate everything in code, or to facilitate a design time experience for you? We may have other options to accomplish this, or we may be able to add something. The more we understand the specific use-case here the more we can help here.

@merriemcgaw merriemcgaw self-assigned this Oct 22, 2024
@merriemcgaw merriemcgaw added 📭 waiting-author-feedback The team requires more information from the author and removed untriaged The team needs to look at this issue in the next triage labels Oct 22, 2024
@towebo
Copy link
Author

towebo commented Oct 24, 2024

With the property ClientSize you can be sure that you get the space you want to the right of controls on the form when you design the form in the designer.
Let's say you want to place controls 12 pixels in from the lefft side of the form and you'd like to have the same margin to the right. If you add 12 pixels (left spacing) + 150 pixels (control width) + 12 pixels (right spacing) = 174 pixels and set 174 as the form's width you won't get 12 pixel spacing to the right. This is because the form size include the border.

@dotnet-policy-service dotnet-policy-service bot added untriaged The team needs to look at this issue in the next triage and removed 📭 waiting-author-feedback The team requires more information from the author labels Oct 24, 2024
@Tanya-Solyanik Tanya-Solyanik removed the untriaged The team needs to look at this issue in the next triage label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues
Projects
None yet
Development

No branches or pull requests

3 participants