When you add a textbox via the VS designer, it creates a variable of the same name to "point" to the textbox - the same thing applies to a button.
If you want to create the textbox and button manually via your code, then you need to do something equivalent in your code to "track" the controls.
It's easy to do, if it's only one textbox and one button you are creating:
private TextBox myTextBox = new TextBox();
private myButton = new Button();
...
Controls.Add(myTextBox);
Controls.Add(myButton);
It gets more complex if you are adding a number of them as pairs and want the button to reference it's matching Tetxbox, but even then the framework makes it easy:
TextBox tb = new TextBox();
b = new Button();
...
b.Tag = tb;
Controls.Add(tb);
Controls.Add(b);
...
private void MyButton_Click(object sender, EventArgs e)
{
Button b = sender as Button;
if (b != null)
{
TextBox tb = b.Tag as TextBox;
if (tb != null)
{
myStringVariable = tb.Text;
...
}
}
}