private void PortStateUpdate() { if (IsPortOpen()) { btOpenClose.Image = global::DockSample.Properties.Resources.connect; lableConectState.Text = GetPortSetting(); lableConectState.Font = new Font(lableConectState.Font, FontStyle.Regular); lableConectState.ForeColor = Color.Green; LinkTimer.Start(); } else { btOpenClose.Image = global::DockSample.Properties.Resources.connection_error; //lableConectState.Text = "No Conection"; lableConectState.Font = new Font(lableConectState.Font, FontStyle.Strikeout); lableConectState.ForeColor = Color.Red; LinkTimer.Stop(); } }
private void PortStateUpdate() { if (IsPortOpen()) { tSBConnect.Image = global::TerminalTool.Properties.Resources.connect; labelConnect.Text = GetPortSetting(); //labelConnect.Font = new Font(labelConnect.Font, FontStyle.Regular); //labelConnect.ForeColor = Color.Green; labelConnect.UseCustomForeColor = false; LinkTimer.Start(); } else { tSBConnect.Image = global::TerminalTool.Properties.Resources.connection_error; //lableConectState.Text = "No Conection"; labelConnect.Font = new Font(labelConnect.Font, FontStyle.Strikeout); //labelConnect.ForeColor = Color.Red; labelConnect.UseCustomForeColor = true; LinkTimer.Stop(); } this.UpdateStyles(); }