I want to add a Textfield to my Form in C#, when I press a button.
####################
| ______ |
| [__ADD_] |
|__________________|
####################
| ______ |
| | TF | |
| |______| |
| ______ |
| [__ADD_] |
|__________________|
This is, how my Program mainly should look, before and after pressing the Button. Right now I'm approaching the Problem like this:
public partial class MainWindow : Window
{
int i = 0;
TextBox[] t = new TextBox[80];
Button[] b = new Button[80];
public MainWindow()
{
InitializeComponent();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
t[i] = new TextBox();
b[i] = new Button();
i++;
}
}
So actually, I'm allready creating the Fields, but I can't show them.
How do I show them?