DateTime, an exception of type 'System.InvalidOperationException'
问题 Haveing this problem with a TimePicker that i am using. When i dont have selected any time I am getting this error: An exception of type 'System.InvalidOperationException' Where the exception occurs is on this line: DateTime break1S = (DateTime)startBreak1.Value; The problem is that it sets a default value when you dont set any value in the picker. But why wont it use it? Here is how the local variables look like: You can see that break1S have a value so what is the problem. Here is the whole