A
A
Alexander Chernyshev2022-01-16 18:17:49
C++ / C#
Alexander Chernyshev, 2022-01-16 18:17:49

How to return the original size of the TableLayoutPanel?

Faced another WinForms glitch. Inside my UserControll there is a TableLayoutPanel with Fill docking and autoscroll. All columns and rows have a fixed width/height (using Resize I calculate what cell sizes I need and write them into the column/row styles). When the component expands, the panel expands normally, I can easily resize all rows and columns to the new size.
When compressed back, glitches begin. The last column and the last line ignore any settings and assign themselves such a size that the "virtual" size of the component remains the maximum that it has been for the entire time the program was running. "Virtual" in the sense that it is visible only at the maximum of the scroller. Accordingly, unnecessary scrollers come out and the text in the last cells is not visible. I can't disable autoscroll - sometimes I really need vertical scrolling.
Has anyone encountered such a glitch? How to reset this "virtual" panel size?
It is not possible to assign a maximum to the scroller.
It is not possible to assign a width to the column itself - only to the column style, and the style is ignored.
Tried removing row/column styles - to no avail.
Added an extra empty column without components - now it expands indefinitely, my data is visible, but the scrollers get in the way.
.NET Framework 4.6, VS 2019

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question