C# Windows Form Application: How to put 5 different data in 5 different labels using a loop

  c++, visual-studio, visual-studio-2019, windows

I took a table_layout_panel of 1 row by 5 columns and put 5 labels in all 5 columns.

Now I am trying to insert different data in these 5 labels.

For Example:-

using a for loop { print 1 to 5 }

The result should be like:-

    label1.Text = "1";
    label2.Text = "2";
    label3.Text = "3";
    label4.Text = "4";
    label5.Text = "5";

Or suggest if there is any other way to do this.
IDE: Visual studio 2019′

Source: Windows Questions

LEAVE A COMMENT