Built something? We create video reels & spotlights for GitHub projects.Promote your project →
Home / Developers / m4k4ss4rh4ck3r
Developer Profile

m4k4ss4rh4ck3r

Discovered public repositories for m4k4ss4rh4ck3r in the GitHub catalog.

↗

m4k4ss4rh4ck3r/Count-Down-The-Time

public int seconds; // detik public int minutes; // menit. public int hours; // jam public bool paused; // mendeklarasikan pause //code untuk mejalankan tombol private void button2_Click(object sender, EventArgs e) { if (paused != true) { if ((textBox1.Text != "") && (textBox2.Text != "") && (textBox3.Text != "")) { timer1.Enabled = true; button1.Enabled = true; button2.Enabled = false; button3.Enabled = true; textBox1.Enabled = false; textBox2.Enabled = false; textBox3.Enabled = false; textBox4.Enabled = false; try { minutes = System.Convert.ToInt32(textBox2.Text); seconds = System.Convert.ToInt32(textBox3.Text); hours = System.Convert.ToInt32(textBox1.Text); } catch (Exception ex) { MessageBox.Show(ex.Message); } } else { MessageBox.Show("Incomplete settings!"); } } else { timer1.Enabled = true; paused = false; button2.Enabled = false; button1.Enabled = true; } } //Code untuk mempaused waktu private void button1_Click(object sender, EventArgs e) { // Pause the timer. timer1.Enabled = false; paused = true; button1.Enabled = false; button2.Enabled = true; } //Code untuk stop private void button3_Click(object sender, EventArgs e) { // Stop the timer hehe. paused = false; timer1.Enabled = false; button1.Enabled = false; button3.Enabled = false; button2.Enabled = true; textBox4.Clear(); textBox3.Clear(); textBox2.Clear(); textBox1.Clear(); textBox1.Enabled = true; textBox4.Enabled = true; textBox3.Enabled = true; textBox2.Enabled = true; textBox1.Enabled = true; lblHr.Text = "00"; lblMin.Text = "00"; lblSec.Text = "00"; } //Code untuk waktu private void timer1_Tick(object sender, EventArgs e) { // memverifikasi waktu if ((minutes == 0) && (hours == 0) && (seconds == 0)) { // kalau waktunya habis secara otomatis clear // kalau waktunya habis maka akan ada pesan timer1.Enabled = false; MessageBox.Show(textBox4.Text); button1.Enabled = false; button3.Enabled = false; button2.Enabled = true; textBox4.Clear(); textBox3.Clear(); textBox2.Clear(); textBox1.Enabled = true; textBox4.Enabled = true; textBox3.Enabled = true; textBox2.Enabled = true; textBox1.Enabled = true; lblHr.Text = "00"; lblMin.Text = "00"; lblSec.Text = "00"; } else { // Else melanjutkan perhitungan. if (seconds < 1) { seconds = 59; if (minutes == 0) { minutes = 59; if (hours != 0) hours -= 1; } else { minutes -= 1; } } else seconds -= 1; lblHr.Text = hours.ToString(); lblMin.Text = minutes.ToString(); lblSec.Text = seconds.ToString(); } }

FOR MAINTAINERS

Built something? Put it in front of millions of developers.

We make a short reel about your project and post it across YouTube, Instagram, Threads, and X. Send a link, we do the rest.

SPONSORED Sponsored Partner