namespace WindowsFormsApplication1 { public partial class Form1 : Form { //Decalre As Global For Use Anywhere... TextBox txtMyNewTextBox = new TextBox();
private void button1_Click(object sender, EventArgs e) { //Set The Location On The Form Using X & Y Axes... txtMyNewTextBox.Location = new Point(12, 12); //It Will Add New Textbox To Form Runtime... this.Controls.Add(txtMyNewTextBox); } //Using Below You Can Retrieve value Of New Textbox... private void button2_Click(object sender, EventArgs e) {
//You Can Store It In Variable….
string store= txtMyNewTextBox.Text;
//You Can Store It In Another Textbox Also… TextBox1.Text = txtMyNewTextBox.Text; } }
}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: