public void item_click_listview(object sender, MouseEventArgs e) { tbSearch.Text = listView1.SelectedItems[0].Text; NewWord resultSearch = new NewWord(); Word result = new Word(); result = resultSearch.GetWordWhenSearch(tbSearch.Text); tvMeaning.Text = result.ViWord; tvExample.Text = result.Example; tvType.Text = result.Type; }
private void btSearch_Click(object sender, EventArgs e) { string KeyWord = tbSearch.Text; NewWord resultSearch = new NewWord(); Word result = new Word(); resultSearch.AddRecentWord(KeyWord); result = resultSearch.GetWordWhenSearch(KeyWord); if (result != null) { tvMeaning.Text = result.ViWord; tvExample.Text = result.Example; tvType.Text = result.Type; } else { MessageBox.Show(message_wordnotfound); } }