public void PrintlnQuestion(string keyword, string hint) { if (this.txbKeyword.InvokeRequired && this.txbHint.InvokeRequired) { VoidString2 println = PrintlnQuestion; this.txbKeyword.Invoke(println, keyword); this.txbHint.Invoke(println, hint); } else { this.txbKeyword.Text = keyword; this.txbHint.Text = hint; } }
/// <summary> /// update the keyword and hint on textboxes /// </summary> /// <param name="s"></param> public void updateQuestion(string s) { Debug.WriteLine("question and hint: " + s); string keyword = ""; while (s[0] != ' ') { keyword += '*'; s = s.Substring(1); } s = s.Substring(1); if (this.txbKeyword.InvokeRequired && this.txbHint.InvokeRequired) { VoidString2 printlnQuestion = PrintlnQuestion; this.txbKeyword.Invoke(printlnQuestion, keyword, s); this.txbHint.Invoke(printlnQuestion, keyword, s); } else { this.txbKeyword.Text = keyword; this.txbHint.Text = s; } }