I've developed and windows form application. It has a number of dropdown menus which select a length of time like 00:30:00 (30mins). When a time period is chosen and the start button clicked it works fine.
However, if someone forgets to select the time period then the application throws the exceptions below:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
How can I prevent this from happening. I put a messagebox in to inform the user that it was not selected but the application still closes. I think there must be a very simple way of getting the program not to treat this as an error? Can you please help.
I have made a work around that sets the timer to a value if it is blank. But this sets the timer going.
Thanks
Paul
However, if someone forgets to select the time period then the application throws the exceptions below:
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Input string was not in a correct format.
How can I prevent this from happening. I put a messagebox in to inform the user that it was not selected but the application still closes. I think there must be a very simple way of getting the program not to treat this as an error? Can you please help.
I have made a work around that sets the timer to a value if it is blank. But this sets the timer going.
Thanks
Paul