The thing can be, to write the Text property of the Button inside the TextBox, or append the text to it.
Take the following scenario as example,
Button button = new Button();
button.Text = "2";
button.Click += Button_Click;
TextBox textBox = new TextBox();
Now upon click, you can handle the event and write its value to the TextBox. Like this
void Button_Click(object sender, EventArgs e) {
Button button = sender as Button;
string value = button.Text;
textBox.Text += value;
}
This is a very basic example of this project and scenario, for a simple example of this I had a project for the Calculator application, you can view that application to understand this pattern, get the source code for that at
https://code.msdn.microsoft.com/Simple-Calculator-34e18835[
^]