Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
So here is a tip on how to improve upon this code. Do not silently catch exceptions! Instead, create a very simple logging mechanism that allows you to inspect the exception, either from code or during debugging.public static class InputBox{ public static Exception LastError {get; private...
25 Dec 2011Paladin2000 3 alternatives
A simple data entry dialog functionally similar to a MessageBox.
Consider the scenario where the input value must be valid.public static double? GetDouble(string caption, string defaultValue, bool mustBeValid = false){ ClearLastError(); using (InputForm inForm = new InputForm(caption, defaultValue)) { while (true) { ...
Doing that 'computer thing' ever since the C64.
Sometimes I feel that being a programmer is much like being a doctor: You just have to know everything and if you don't, something dies.
Either being an application or a patient.
Oddly enough, more people care about the death of their application, than the massacre of people...