J
jquerijero
Guest
I'm refraining from responding more to this thread, but if you are curious when to use a self-terminating form that is also fully encapsulated; There is no control flow difference when the form has to terminate prematurely or continue on normally. This is normally a case when you have to display a form in the middle of a certain process where the form could be shown or not shown. Using the approach of handling the termination inside the Load event allows the caller code to be simplified to just NEW and SHOW (again, if there are no difference in control flow between normal and early termination). This way you don't have to special case the creation and showing of the form by checking additional condition. This should also handle SHOWDIALOG, if you assign the DialogResult property of the form to Cancel/No inside the Load event, it will have an effect of closing the dialog-box. This way your calling program will just need to do NEW, SHOWDIALOG, IF DialogResult = OK THEN for both normal and early termination. Note: I've used the first case. The ShowDialog, I have not.
Continue reading...
Continue reading...