I'm trying to write a program where you can enter in 2 times into 2 DateTimePickers and it will tell you how long you have been doing something.
private void btnAdd_Click(object sender, EventArgs e)
{
DateTime start = dtpStart.Value;
DateTime end = dtpEnd.Value;
TimeSpan gameplay = end - start;
lblGameplay.Text = "Total Daily Gameplay Hours: " + gameplay.TotalHours.ToString() + " Hrs";
prgGameplay.Value = int.Parse(gameplay.TotalHours.ToString());
}
That is the code I have now, the only problem I have now is every time I add a duration, I want it to add onto the progress bar and my label so I imagine I need some form of loop.
Much help would be appreciated
This post has been edited by xDementiax: 16 December 2008 - 04:14 AM

New Topic/Question
Reply




MultiQuote





|