L
Laura Stern
Guest
OK. So the form decides for itself if it is viable. I'll accept that. As for the other part, I've already given my opinion. I very strongly discourage you from this approach. It is convoluted, and unnecessary. In fact, as stated, the Load event will never fire because it only fires when you show the form, which you will not be doing. I'll say again: Have the constructor return an error as you originally proposed. The caller can handle this and move on to do something else. The class instance will automatically go away and never get returned from the constructor. You never need to call Close() if the form is not shown. Clean, neat and easy. (Sorry jquerijero. Didn't mean to step on toes but I don't know how to state my opinion on this more diplomatically!) And I will also throw in that it is usually unnecessary to provide a ShowModalDialog() method in the form. Again, it is the caller that creates the form and then calls form:ShowDialog() on it directly.
Continue reading...
Continue reading...