As you can see, after hitting button1 for the first time, we will jump to a CountDown() method, which I originaly planed on using to put my timer code in to keep things clean.Code:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication1 { public partial class form1 : Form { public form1() { InitializeComponent(); } private void form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { int count = 1; if (count == 1) { System.Diagnostics.Process.Start("explorer.exe"); //start explorer count++; // increment count by 1 to skip starting explorer next time. // this.Visible = false; this.label1.Visible = false; // get rid of the label telling you your session will start when you hit 'Accept' CountDown(); // start the counter } } private void button1_MouseEnter(object sender, EventArgs e) { button1.BackColor = Color.FromArgb(240, 240, 240); } private void button1_MouseLeave(object sender, EventArgs e) { button1.BackColor = Color.FromArgb(192, 192, 255); } private void button2_MouseEnter(object sender, EventArgs e) { button2.BackColor = Color.FromArgb(240, 240, 240); } private void button2_MouseLeave(object sender, EventArgs e) { button2.BackColor = Color.FromArgb(192, 192, 255); } private void button2_Click(object sender, EventArgs e) { System.Diagnostics.Process.Start("shutdown", "-r"); // Shutdown system. ending patron session this.Close(); } private void pictureBox1_Click(object sender, EventArgs e) { } private void CountDown() { } private void DisplayMethod() { } private void form1_Click(object sender, EventArgs e) { this.Close(); } // this is for safty to kill the application at any time durning testing } }
I have looked on MSDN, for timer: http://search.msdn.microsoft.com/sea...=0&query=timer
but there was so much there, I didn't know where to really start, I also tryed google, with confusing results.
It's prob not as hard as I'm making it. I wanted this timer to count down from 30 min. Can someone *please* help me get started with a timer that would count down 30 min?
EDIT: ok, this is what I have for my timer so far http://www.nomorepasting.com/paste.php?pasteID=64923 when I set int StartTime = 900; my program does its disapearing thing for exactly 9 secounds... but when I set int StartTime = 1000; my program only does its thing for 6 secounds... wierd or what? I have the alarm component interval set to 1



LinkBack URL
About LinkBacks


