private void buttonAdd_Click(object sender, EventArgs e) { if (textBoxString.Text != null) { AddStr.Invoke(this, new ViewEvent(textBoxString.Text)); } }
void Add() { if (AddStr.Text == String.Empty) { AddStr.Focus(); return; } tmpList.Add(AddStr.Text); AddStr.Text = String.Empty; SortDescAndView(); AddStr.Focus(); }
void window1_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { if (AddStr.Text != String.Empty) { Add(); } else { AddStr.Focus(); } } }