C
C#16h ago
sed

runtime size of label different from design time size, causing issue

hi guys, i'm doing a c# WinForms project for my a-level and there's an issue that's driving me crazy label14 is the label full of periods, and everything is contained in a flowlayoutpanel in design time the width is 678, and doesn't cause a horizontal scrollbar to appear; i can't change its width in design time anyway due to being contained in a flowlayoutpanel in run time however its width is somehow 702 (and now only spans two lines rather than three), and now causes the horizontal scrollbar to appear due to a small portion of it sticking outside the flowlayoutpanel width, which I do not want I have no idea what's causing this or how to fix it effectively; the only thing that worked really was giving it a maximum size, but that's not sustainble and the flowlayoutpanel will be dynamic please if someone could point out what's going on that'd be great, thank you so much
No description
3 Replies
sed
sedOP16h ago
the intention is for the flowlayoutpanel to be strictly vertically scrollable and dynamic, so I turned autoscroll on, wraptext off and flowdirection topdown
Jimmacle
Jimmacle12h ago
you have discovered why designing layouts using fixed sizes and margins isn't a good idea
sed
sedOP4h ago
sorry i dont understand what you mean by fixed sizes and margins i can't change the labels' sizes, their widths change according to text length which is expected, but in run time the text wraps differently than in design time and basically every time it causes the horizontal scrollbar to appear

Did you find this page helpful?