Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Getting lot of space between labels in a Table Layout for row (r=0) from data table but when it comes to r=1 their are no spaces between label.Here is my code:

for (int i = 0, r = 0; i < dt.Rows.Count; i++, r++)
{
  Label line = new Label();
  Label Quest = new Label();
  Label Quest = new Label();
  Quest.Text = Convert.ToInt32(r + 1).ToString();
  Quest.Text = dt.Rows[r]["Ques"].ToString();
  Quest.AutoSize = true;
  tableLayoutPanel1.Controls.Add(Quest);
  tableLayoutPanel1.Controls.Add(Quest);
 }
Posted
Updated 4-Sep-14 21:54pm
v2
Comments
Nathan Minier 5-Sep-14 9:00am    
Do you mean to be double initializing and assigning Label Quest, or did you do some code sanitizing?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900