Normal closure for non-modal forms and open modal forms when using a block. Enough?

Develops an MDI Windows Forms application.

From the welcome window (such as the home page), the user can open certain windows for adding or editing objects, for example, an order or a customer. Each of them opens in its own model window (like MDIChild). Adding a new record in some situations is performed in a modal window.

I DO NOT Explicitly do Dispose () in weak windows. According to the exam, during debugging, when the "Close" button of the forms is pressed, the Dispose () method in the Designer.cs file is executed and the base.Disposing method is called. I understand this to understand that the form is really deleted when you click the close button.

In the dialog boxes, I open them in the use block, which, as I understand it, will be removed from the window when the used block is completed.

So, is my understanding and approach correct?

I did Google on this. There seem to be some pretty strong proponents of different approaches that make me a little unsure that my approach is in order.

Thank you for your clarification.

Thank you and respectfully.

+3
source share
1 answer

Do you have a variable in the use block? you are very satisfied. If this class does not contain unmanaged resources. C # dialogs and forms are not unmanageable. Most of everything is in C # managed memory. Therefore, use should be sufficient.

You have a use clause, so the following does not apply, but it's good to know

" IDisposables , ?" . IDisposable , , , . .

,

# - ?

, , , , .

0

All Articles