Dynamic control creation in C#

D

DMP

Hi,
How can i create control dynamically in C# (Window Application) whose
property value retrive from database ?
regards,
 
C

cody

TextBox tb = new TextBox();
tb.Text = GetValueFromDB();
myForm.Controls.Add(tb);

That's all. Maybe you additionally want to set position of your textbox and
size.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top