简体   繁体   中英

Do not see a label resize in tablelayoutpanel

I have a tablelayoutpanel and I have 5 labels on the first row (there are 4 rows). there are 5 columns and the width of the last column is the width of the scroll bar (basic scrollbar). When I put commands on the panel, the scrollbar is sometimes visible, sometimes not, and I resize my last column according to that. My problem is when I do not have the scroll bar and just after I have it: I want to resize my labels but without seeing the change happen.

I tried Suspend and Resume, but it doesn't work correctly. I tried also to set visible or not the tablelayoutpanel but nothing.

here the code :

tableLayoutPanelGroupView.ColumnStyles[5].Width = 0;

and after :

tableLayoutPanelGroupView.ColumnStyles[5].Width = SystemInformation.VerticalScrollBarWidth;

Finally, I found a solution: before changing the size of my last column in the tablelayoutpanel, I set visibility of my labels to false and I reset visibility to true when I'm done.

Thanks to persons who try to help me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM