private void btnSearch_Click(object sender, EventArgs e) { ChapterDB chapterDB = new ChapterDB(); ChapterDBAccess.ChapterSet result = chapterDB.ShowDialog(txtSearch.Text); if (result != null) { chapterSet = result; } }
private void txtSearch_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode != Keys.Enter) { return; } e.SuppressKeyPress = true; ChapterDB chapterDB = new ChapterDB(); ChapterDBAccess.ChapterSet result = chapterDB.ShowDialog(txtSearch.Text); if (result != null) { chapterSet = result; } }