Hello, I am very new to windows programming. I am just playing around with it and I was wondering how to erase the text in a box after hitting a button to put the text in another box. Instead, the text just stays there and if you hit the button again it just puts that text out again. Here is the code I used to get the text to go in to the box.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
namespace Windows_1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
privatevoid button1_Click(object sender, RoutedEventArgs e)
{
listBox1.Items.Add(textBox1.Text);
}
}
}