public ATL扫描(string name, 串口 serialPort) { InitializeComponent(); this.Text = name; SerialPort = serialPort; SerialPort.formMessageReceived += new SerialPortLib.MessageReceivedEventHandler(SerialPort_formMessageReceived); }
//private bool US_flag; public 电子秤扫描(string name, 串口 serialPort) { InitializeComponent(); this.Text = name; AName = name; SerialPort = serialPort; //SerialPort.formStatusChanged += new SerialPortLib.ConnectionStatusChangedEventHandler(SerialPort_formStatusChanged); SerialPort.formMessageReceived += new MessageReceivedEventHandler(SerialPort_formMessageReceived); }