void hook_KeyPressed(object sender, KeyPressedEventArgs e) { Thread.Sleep(10); SendKeys.Send("^(c)"); //SendKeys.SendWait("^(c)"); strClip = Clipboard.GetText().Trim().ToLower(); Clipboard.Clear(); if (strClip != "") { if (newDic.search(strClip) != "Không tìm thấy từ này !") { Form_Information fi = new Form_Information(strClip, newDic.search(strClip)); fi.Show(); } else { Form_Ask fa = new Form_Ask(); fa.Show(); } } else { MessageBox.Show("SCAN NO TEXT !\n Try again!"); } }
//search từ private void btnSearch_Click(object sender, EventArgs e) { if (txtSearch.Text != "") { string RESULT = txtSearch.Text.ToString().ToLower(); if (newDic.search(RESULT) != "Không tìm thấy từ này !") { Thread thr = new Thread(downloadImage); if (_mode == 0) // chế độ online { thr.Start(); } else { LoadImage(RESULT); } Form_Information fi = new Form_Information(RESULT, newDic.search(RESULT)); fi.Show(); } else { Form_Ask fa = new Form_Ask(); fa.Show(); } // load hình từ url ra form } else { MessageBox.Show("Please enter text !"); } }