The first example is not redundant. You should always dispose IDisposableof the moment you finish with it, and in the case of a modal form, it definitely reaches the goal.
The second example, however, will lead to errors. The method Showreturns immediately and the form continues to display. However, the generated code usingwill immediately take the form Disposeand force it to leave. The form should be deleted only after its completion.
source
share