project not stopping

I'm sure this is completely stupid, but I have a windows application project in .net 2005, startup form is set to my one and only form.
Whenever I click the X to close it, the project continues to run and I have to hit the stop button.
This is probaby not the behavior 'after' I've deployed it, but I'd like it to work as expected while I'm testing...any ideas?
LVL 67
sirbountyAsked:
Who is Participating?
 
Kinger247Connect With a Mentor Commented:
I think the loop from the other thread is the reason.
0
 
Kinger247Commented:
Have you got something running or have you referenced something in that form ?
0
 
sirbountyAuthor Commented:
I create 4-6 controls dynamically - could it be because I'm not disposing of them?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Kinger247Commented:
If theres something left in memory, it'll carry on running.
Try disposing, if that doesn't work , pin it down by commenting out parts of your code to see whats stopping it from unloading.
0
 
sirbountyAuthor Commented:
You know though - looking at the code, I actually had to put in a me.show in my form load for the form to even appear...

Something's screwy here... :(

I tried this:

    Private Sub frmQuiz_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        For Each ctl As Control In Controls
            ctl.Dispose()
        Next
    End Sub

But still no luck...or do I need to set each to Nothing?
0
 
Kinger247Commented:
No, sounds like something else.
What are you running in your form on startup ? this could be linked with your other problem.

Remove the code that runs on your load event, then see if your labels appear and your form shuts down.
0
 
sirbountyAuthor Commented:
Oh good and wise Kinger247 - the form now loads properly... :)
I moved my call to the Shown event.
But it still doesn't close properly.

I do have a oledb connection - tried closing that as well in my formclosing, but still no good...
0
 
sirbountyAuthor Commented:
I believe you're correct...thanx.
0
 
Kinger247Commented:
If you need a loop, put all the code from LoadQuestion into a timer and start the timer from the form load event.
0
 
sirbountyAuthor Commented:
?
Can't get my head around that one.
Perhaps I'll open another question when I get back...T-day is tomorrow and then 10-yr wedding anniversary this weekend...catch up with you next week then. :^)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.