I want to put a value in other dynamically created textbox if there is a changes in a specific textbox that was also dynamically created. How could I possibly do this?
this is how i created the textbox:
for (int x = 0; x < dt.Rows.Count; x++)
{
TextBox txt = new TextBox();
txt.Name = dt.Rows[x]["field_name"].ToString();
txt.Text = txt.Name;
txt.Width = 200;
var margintx = txt.Margin;
margintx.Bottom = 5;
txt.Margin = margintx;
flowLayoutPanelText.Controls.Add(txt);
}
Here is the output of it:

Example if I put a value to the Mag Data, it will also pass the value to Card Number and Exp Date. How could I possibly do this?
You can dynamically add an event handler to your Dynamic
TextBox'sTextChanged Event and since you are also using yourFieldNames as yourTextBoxName you can cast your events sender object to determine whichTextBoxwas changed.The issue that you are having is that your
NameProperty is not accessable as aTextBoxi.e you can not do “Card Number”.Text you will need to search the Control Collection for the TextBox named “Card Number” you can use the Controls.Find Method to do so.i.e.