Answer the question
In order to leave comments, you need to log in
How to add controls programmatically in a loop?
There is a base where information is stored organizations, the name of the organization, its description, the name of its logo.
You need to display this information in the label, in one name, in the second description and logo, respectively, in the picturebox.
How to create controls in a loop?
Answer the question
In order to leave comments, you need to log in
string[] items = new string[]{ "Item 1", "Item 2", "Item 3" };
foreach(var item in items){
new Label { Text = item };
}
In general, I would recommend making a UserControl that reflects the essence of the desired control from your image. Just "draw" as you like, add public properties for the name, description and log, where you will assign the appropriate values.
You can do it not through three properties, but through one property - a model in which these three properties are represented. And model to connect through DataBindings with controls.
Next, just load the data and create your controls in a loop, adding them, as you suggested in the first answer from VoidVolker
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question