I have a user a control that i call on another form. everything is working fine and amazingly good. but there is one problem that serve as an obstacle to me. i have Label1, Label2 on the user control, they both adjust their heigt at run time. but the problem is they dont scale, they always stayed at a fixed position despite height changing.
Graphics g = CreateGraphics();
SizeF size = g.MeasureString(label1.Text, label1.Font, label1.Width);
label1.Height = int.Parse(Math.Round(size.Height + 2, 0).ToString());
label2.Height = int.Parse(Math.Round(size.Height + 2, 0).ToString());
label2.Top = label1.Bottom;
this.Height = label2.Bottom + 34;

Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Nov 12, 2021, 12:08 AM EST
Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Nov 12, 2021, 9:44 AM EST
Abdu AbdulRank #5,389 · 301 reputationPosted Nov 12, 2021, 9:22 AM EST
Abdu AbdulRank #5,389 · 301 reputationPosted Nov 12, 2021, 10:40 AM EST