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.
Locked
User avatar
Lembasts
Posts: 337
Last visit: Tue Oct 12, 2021 6:38 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: 14951
Last visit: Sun Oct 17, 2021 11:52 am
Answers: 14
Has voted: 3 times
Been upvoted: 11 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.

Locked