private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { DBExchange.AddLine(textBox1.Text, false); } }
public void Read() { while (Continue && RS232.IsOpen) { try { RecievedData = RS232.ReadLine(); //DBExchange.AddLine(RecievedData, true); //MainForm.textBox.Invoke(new Action(() => { DBExchange.AddLine(RecievedData, true); })); MainForm.listBox.Invoke(new Action(() => { DBExchange.AddLine(RecievedData, true); DBExchange.LoadTable(); })); } catch (TimeoutException) { } } RS232port.RS232.Close(); }
private void button1_Click(object sender, EventArgs e) { DBExchange.AddLine(textBox1.Text, false); }