示例#1
0
 private void timerBattery_Tick(object sender, EventArgs e)
 {
     this.clockLbl.Text = DateTime.Now.ToString("HH:mm:ss");
     BatteryLevel       = BatteryInfo.GetBatteryLifePercent();
     batteryBar.Value   = BatteryLevel;
     if (BatteryLevel < 20)
     {
         this.batteryBar.ForeColor = Color.Red;
     }
 }
示例#2
0
 public HHTToolBar()
 {
     InitializeComponent();
     this.clockLbl.Text = DateTime.Now.ToString("HH:mm:ss");
     BatteryLevel       = BatteryInfo.GetBatteryLifePercent();
     batteryBar.Value   = BatteryLevel;
     if (BatteryLevel < 20)
     {
         this.batteryBar.ForeColor = Color.Red;
     }
 }