private void button7_Click(object sender, EventArgs e) { try { NewSerialPortSetting setting = (NewSerialPortSetting)DataAction.SaveStatic.ReadBinF(Parent.Text); ANDserial = new NewSerialPort(setting._port, setting._baudrate, setting._parity, setting._databit, setting._stopbit); ANDserial.Open(); if (ANDserial.IsOpen) { this.BackColor = Color.LightGreen; } } catch { } }
public ANDweigh(NewSerialPort serialport) { InitializeComponent(); ANDserial = serialport; Name = ANDserial.Name; }