UserControl in

Posted on 2005-04-28
Last Modified: 2012-06-21
I have to clear some files on the unloading of my project.  I am using Windows Application (Not Web Application)
I have a usercontrol in my project. Before unloading the control i want to call my procedure which will delete some temp files which i have created.
What's the appropriate event in this case to be used. I don't have Unload event of usercontrol in windows application project.

Thanks for the help

Question by:snomi
    LVL 25

    Expert Comment

    Why on unloading the usercontrol, why not using the closing event of your mainform

    Author Comment

    i have already done that, i was only wondering that how can i find the unload event for the usercontrol or any other avaiable event in its place.
    LVL 8

    Accepted Solution

    Hi snomi,

    if I understand you correctly, you are looking for a method/function/event in your user control, to use to perform 'cleanup' operations.

    The recommended way to do this is to implement the Dispose() method in your usercontrol.

    In the Dispose() method, clean up and release any resource your control is holding on to.

    When you want to destroy the control from a client form and ensure it cleans up after itself, call the Dispose method.

    Let me know if you need further info.



    Author Comment

    Hi David,

    Thanks for very good reply. I also want to thanks the other people who have helped me in this problem

    Take Care


    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now