Beispiel #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;
     }
 }
Beispiel #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;
     }
 }