2
Reply

How to set auto size the dynamic label box in c#?

Parameswaran R

Parameswaran R

Jan 27 2016 2:30 AM
351

I have tried follow code, My question passed to Label text, Question size longer than label text, So Can't view full question in label Box. Please solve this bug.

Label dynamiclabel = new Label(); dynamiclabel.Location = new Point(38, 30); dynamiclabel.Size = new Size(200, 32); dynamiclabel.Name = "lbl_ques"; dynamiclabel.Text = question;                dynamiclabel.AutoSize = true; dynamiclabel.Size = new System.Drawing.Size(900, 26); dynamiclabel.Font = new Font("Arial", 12, FontStyle.Regular);

Answers (2)