Well, you've added the Text boxes to this.Controls
so you can go rummaging in there to find them again
foreach(var c in this.Controls){
if(c is TextBox t && t.Name.StartsWith("TextBox"))
MessageBox.Show(t.Text);
I'd pick better names for Name than "TextBox"+integer but so long as you don't name other text boxes that you don't want to consider with the same prefix this will pick up only those you added dynamically
If you know the controls by name I,e, you know that you want the address and that the user has certainly typed it into TextBox 2, you can just access Controls indexed by that name:
this.Controls["TextBox2"].Text;
Doesn't even need casting to a TextBox.. all Controls have a text property
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…