Click here to Skip to main content
15,914,444 members

Comments by Gouthamitks (Top 8 by date)

Gouthamitks 18-Jun-14 2:08am View    
The problem is when i insert time in seconds for eg.,100, and click start . Timer runs,but when i click pause and click resume.,the time is running very fast.
Gouthamitks 18-Jun-14 2:01am View    
I made it in windows application. But the timer control is not working correctly.
Here is the code for the windows form

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;



namespace SuperTimer
{
public partial class SuperTimer : Form
{
int Rtime = 0, hours = 0, mins = 0, seconds = 0, Usertime, i, j, k, l, m, n,stop,resume;
public SuperTimer()
{
InitializeComponent();
}

private void SuperTimer_Load(object sender, EventArgs e)
{
btnpause.Enabled = false;
}


public void btnstart_Click(object sender, EventArgs e)
{
btnpause.Enabled = true;
if (txtsec.Text != string.Empty)
{
if (btnstart.Text == "Start")
{
btnstart.Text = "Reset";
Time();
Timer mytimer = new Timer();
mytimer.Tick += new EventHandler(timer_Tick);
mytimer.Interval = 1000;
mytimer.Start();
lblsec.Text = seconds.ToString();
stop = 2;
}

else
{


Reset();
return;
}
}
else
{
lbltimeup.Visible = false;
lblmsg.Text = "Please Enter Time in Seconds";
lblmsg.ForeColor = Color.Red;


}
}
private void Reset()
{
Timer mytimer = new Timer();
txtsec.Text = string.Empty;
mytimer.Stop();

lblsec.Text = "00";
lblmm.Text = "00";
lblhrs.Text = "00";
btnstart.Text = "Start";
stop = 1; seconds = 0;
mins = 0;
hours = 0;

//mytimer.Start();
}
private void Time()
{
lblmsg.Text = string.Empty;
if (txtsec.Text != string.Empty)
{
Usertime = int.Parse(txtsec.Text.ToString());
hours = Usertime / 3600;
Rtime = Usertime - (hours * 3600);
Usertime = Rtime;
mins = Usertime / 60;
Rtime = Usertime - (mins * 60);

seconds = Rtime;
Conditions();
lblhrs.Text = hours.ToString();
lblmm.Text = mins.ToString();
lblsec.Text = seconds.ToString();
}
//else
//{
// lbltimeup.Visible = false;
// lblmsg.Text = "Please Enter Time in Seconds";
// lblmsg.ForeColor = Color.Red;
//}
}
private void Conditions()
{
// if (btnstart.Text == "Start")
// {
if (seconds == 0 && mins != 0)
{
mins = mins - 1;
seconds = 59;
}
if (seconds == 0 && mins == 0)
{
hours = hours - 1;
mins = 59;
seconds = 59;
}
// }
else
return;
}


private void TimerDispalys()
{
seconds = int.Parse(lblsec.Text);

if (seconds != 0)
{
j = seconds;

for (i = 0; i <= j; i++)
{


Timerdisplay();
seconds = seconds - 1;
}


}
}
private void Timerdisplay()
{
lblsec.Text = seconds.ToString();
}

private void txtsec_TextChanged(object sender, EventArgs e)
{




}
Gouthamitks 16-Jun-14 2:51am View    
Thank you Asim. Can u tel me how to do slicing in photoshop..and use them in vs ..pls provide links to that so i can do
Gouthamitks 16-Jun-14 2:49am View    
can we use wpf for web application? I am developing an intranet application.
Gouthamitks 16-Jun-14 2:48am View    
Thank you DD. But i dnt know css properly. Is it better to use images modified by photoshop and use them in my login page eg.,like header,title,login background,controls etc..in login.aspx in visual studio editor