Tuesday, July 28, 2009

How can i generate random labels with a FOR loop?

How can i generate label controls in Visual C++ 2005 over a Form with a FOR loop? I have an matrix table M[i][j] (i, j to n, with random n) that i want to show over that Windows Form. Thanks!

How can i generate random labels with a FOR loop?
Hello.


I don't know the code with visual c++, instead I'll tell you how to do that in vb.net but the concept is the same.





For i as integer = 0 to 10


dim myLabel as new Label


myLabel.Text = "Whatever"


myLabel.Name = "myLabelName" %26amp; i


myTable.Rows.Add(myLabel)


Next





Hope this helps,


Regards.


Wassim.


No comments:

Post a Comment