コード例 #1
0
 private void ClearCommandText(TextBox control, string response)
 {
     if (txtResponse.InvokeRequired)
     {
         AddTextToTextbox c = ClearCommandText;
         Invoke(c, control, response);
     }
     else
     {
         control.Text = string.Empty;
     }
 }
コード例 #2
0
 private void SetTextboxText(TextBox control, string text)
 {
     if (control.InvokeRequired)
     {
         AddTextToTextbox c = SetTextboxText;
         Invoke(c, control, text);
     }
     else
     {
         control.Text = text;
     }
 }
コード例 #3
0
 private void ClearCommandText(TextBox control, string response)
 {
     if (txtResponse.InvokeRequired)
     {
         AddTextToTextbox c = new AddTextToTextbox(ClearCommandText);
         this.Invoke(c, new object[] { control, response });
     }
     else
     {
         control.Text = string.Empty;
     }
 }
コード例 #4
0
 private void SetTextboxText(TextBox control, string text)
 {
     if (control.InvokeRequired)
     {
         AddTextToTextbox c = new AddTextToTextbox(SetTextboxText);
         this.Invoke(c, new object[] { control, text });
     }
     else
     {
         control.Text = text;
     }
 }
コード例 #5
0
 private void AddServerResponseText(TextBox control, string response)
 {
     if (txtResponse.InvokeRequired)
     {
         AddTextToTextbox c = new AddTextToTextbox(AddServerResponseText);
         this.Invoke(c, new object[] { control, response });
     }
     else
     {
         if (control.Text.Length > 0)
         {
             control.Text += Environment.NewLine + Environment.NewLine;
         }
         control.Text += response;
     }
 }
コード例 #6
0
 private void AddServerResponseText(TextBox control, string response)
 {
     if (txtResponse.InvokeRequired)
     {
         AddTextToTextbox c = AddServerResponseText;
         Invoke(c, control, response);
     }
     else
     {
         // substitute \r\n for \n
         if (!string.IsNullOrWhiteSpace(response))
         {
             response = response.Replace("\n", Environment.NewLine);
         }
         if (control.Text.Length > 0)
         {
             control.Text += Environment.NewLine + Environment.NewLine;
         }
         control.Text += response;
     }
 }