Пример #1
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     richText.SelectionStart = richText.Text.Length;
     richText.Focus();
     if (!m_obdInterface.getConnectedStatus())
     {
         MessageBox.Show("A vehicle connection must first be established.", "Connection Required", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         richText.SelectionFont  = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular);
         richText.SelectionColor = Color.Blue;
         richText.AppendText(txtCommand.Text);
         richText.AppendText("\r\n\r\n");
         string text = m_obdInterface.getRawResponse(txtCommand.Text);
         richText.SelectionColor = Color.DarkMagenta;
         richText.SelectionFont  = new Font("Microsoft Sans Serif", 12f, FontStyle.Bold);
         richText.AppendText(text);
         richText.SelectionFont = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular);
         richText.AppendText("\r\n\r\n");
         richText.SelectionFont  = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular);
         richText.SelectionColor = Color.Black;
         if (string.Compare(m_strID, "") == 0)
         {
             richText.AppendText("ELM > ");
         }
         else
         {
             richText.AppendText(m_strID + " > ");
         }
     }
 }