I'm not sure what I'm doing wrong here. Any ideas or help is appreciated. I was thinking of processing the text on a KeyDown event instead, but that didn't work either.
Code:private: System::Void textBox1_KeyDown(System::Object^ sender, KeyEventArgs^ e){
if (e->KeyCode == Keys::Enter) {
this->listBox1->Items->Add(this->textBox1->Text);
++number_of_listitems;
this->textBox1->Text = "";
e->Handled = true;
}
}