Control width vs column width

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 2 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Lembasts
Posts: 405
Last visit: Wed Mar 20, 2024 1:40 pm
Has voted: 1 time
Been upvoted: 1 time

Control width vs column width

Post by Lembasts »

Greetings,
I have a Listview whose width is 700.
I created four columns with a total width of 700 and a scrollbar appears when data is displayed (no value is longer than the column width).
When I change the combined width to 696, no scrollbar appears. At 697 to 699, the scrollbar still appears.
Is this normal behaviour where you have to 'subtract 4' from the total column width?
Thanks
David
by jvierra » Thu Sep 09, 2021 1:35 am
There is alwaqys slop with autodisplay scroll bars. Different controls behave differently and differnt screen resolutions also cause differences.

You might want to check in the C# WinForms forum to see if anyone knows if there is documentation that has sorted all of that out. Normally I have just added more the control width to compensate; usually 10.
Go to full post
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Control width vs column width

Post by jvierra »

There is alwaqys slop with autodisplay scroll bars. Different controls behave differently and differnt screen resolutions also cause differences.

You might want to check in the C# WinForms forum to see if anyone knows if there is documentation that has sorted all of that out. Normally I have just added more the control width to compensate; usually 10.
This topic is 2 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked