Login  |  Register
Home | Articles | Downloads | Resources | About
Contact Us | My Resume
   Topics:  ASP.NET  C#  .NET  XML 
C#
File Name: Dynamically create TextBoxes with C# on Windows Form
File Size: 8,988 bytes
Downloaded: 2397516 times
Posted by WaheedKhan on Saturday, February 26, 2005 (PST)
Click here to download this file
Dynamically create and retrieve TextBoxes data with C# on Windows Form

This example will show you how to create TextBoxes dynamically on Win Form and also you will learn how to retrieve dynamic data from these controls with C#.

 

Comments:

Wow
By ? on Saturday, October 11, 2008 (PST)
Thank you, thank you, thank you, thank you. This is exactly the code I was looking for for the past two hours. Compiled and ran straight away. Hats off to you!

Reply to this Comment

Removing Dynamic textboxes
By ? on Tuesday, October 28, 2008 (PST)
How do i remove dynamic textboxes after i am done?

Reply to this Comment

thanks
By ? on Wednesday, January 21, 2009 (PST)
it's great; really thank you for this code

Reply to this Comment

question
By ? on Tuesday, March 03, 2009 (PST)

this code is great.  I was able to use it effectively, but for one small thing.  Here is the code I have.

private void button1_Click(object sender, EventArgs e)

{

int x = 153;

int y = 307;

int m = 529;

for (int i = 0; i < 30; i++)

{

TextBox tb = new TextBox();

tb.Location = new Point(x, y);

tb.Size = new Size(272, 20);

this.Controls.Add(tb);

TextBox textBox = new TextBox();

textBox.Location = new Point(m, y);

textBox.Size = new Size(145, 20);

this.Controls.Add(textBox);

y += 25;

i++;

}

}

 

As is, clicking the button will create 16 sets of two textboxes, which is fine.  But I only want one set of textboxes to appear on each button click until all 16 sets have appeared.

Reply to this Comment

great...!!
By ? on Monday, March 08, 2010 (PST)
Its a better way.. I like it... Thanks bro...

Reply to this Comment

Add Your Comment

Support this site
If you found all the downloads from Artisticode.com site to be useful, and you feel that it has helped you out, then I'd really appreciate it if you could show your support by donating to Artisticode.com for hosting cost and for the time that I have invested by producing this quality free code, via PayPal.

You can donate as little, or as much as you want by clicking the Make a Donation button. It's free, fast, easy and secure! Your donation will be appreciated.

Thanks for your support!

 
 
Home Articles Downloads Resources About