//Tạo form void setupForm() { nmrHour.Maximum = 24; nmrMinute.Maximum = 59; prgBattery.Maximum = 100; prgBattery.Minimum = 0; prgBattery.Value = Battery.getInstant().getBatteryLifePercent(); lblStateBattery.Text = Battery.getInstant().getBatteryStatus(); lblCapacityBattery.Text = Battery.getInstant().getPercentBattery(); lblStateNetwork.Text = Network.getInstant().getStateInternet(); lblDatetime.Text = Datetime.getInstant().getTime(); }
//Đổi ngày giờ private void btnChangeDateTime_Click(object sender, EventArgs e) { short year = short.Parse(dtp.Value.Date.Year.ToString()); short month = short.Parse(dtp.Value.Date.Month.ToString()); short day = short.Parse(dtp.Value.Date.Day.ToString()); short hour = short.Parse(nmrHour.Value.ToString()); short minute = short.Parse(nmrMinute.Value.ToString()); try { Datetime.getInstant().setTime(year, month, day, hour, minute); } catch (Exception ex) { MessageBox.Show(ex.Message); } }