I want to write a simple stopwatch program, I can make it work with the following code
public Form1()
{
InitializeComponent();
}
Syst
Create a new instance of System.TimeSpan with the initial value of 45 minutes as per you example. Than add the value of the stopwatch to it TimeSpan.Add Method. Conveniently the Stopwatch.Elapsed is of type System.TimeSpan already.
Than use string formatter to print the formatted time into the label. I think one of the other answers already shows how to do that. Otherwise here are some good references on how to format a TimeSpan instance TimeSpan.ToString Method (String) or using a custom formatter.
var offsetTimeSpan = new System.TimeSpan(0,45,0).Add(ss.Elapsed)