Solved

Problem closing windows form

Posted on 2004-09-27
3
202 Views
Last Modified: 2010-04-23
Hi folks,
      I am developing a set of user controls components for a program. The main user control consists of a tab control which can add content as tabs when loaded. For example a user control which I use to authenticate clients has got a "Logon" button. When I click on the Logon button, it loads another control on the tab control as a tab page.
     However, when I have loaded the content on the tab control, I find It difficult to close the windows form hosting the main user control. I can only kill the form by using the "Control -Alt Delete Method"
      Is that garbage collection is late and the windows form can not close because of open resources ?Do I need to explicitly call the dispose method?  PLease help me.
#Dmxflames
0
Comment
Question by:dmxflames
3 Comments
 
LVL 6

Accepted Solution

by:
KGreg earned 125 total points
ID: 12163597
If you're using threads, you need to kill them.  If you have dynamically created disposable objects, dispose of them.

Try that and let me know..  also are you capturing the close or closing events?

KGREG
0
 
LVL 5

Expert Comment

by:thenrich
ID: 12168845
You've got something else going on. The correct solution would be to call the Me.close in the close button of the form and put a me.dispose in the finialize event of the controls. I'm thinking 1 of your controls is procsessing something.
0
 
LVL 8

Expert Comment

by:wguerram
ID: 12172438
Can you post the code of your control.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
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.

747 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

12 Experts available now in Live!

Get 1:1 Help Now