?
Solved

project not stopping

Posted on 2006-11-22
10
Medium Priority
?
220 Views
Last Modified: 2010-04-23
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?
0
Comment
Question by:sirbounty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 17997320
Have you got something running or have you referenced something in that form ?
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17997405
I create 4-6 controls dynamically - could it be because I'm not disposing of them?
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17997434
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 67

Author Comment

by:sirbounty
ID: 17997522
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
 
LVL 10

Expert Comment

by:Kinger247
ID: 17997553
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
 
LVL 67

Author Comment

by:sirbounty
ID: 17997626
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
 
LVL 10

Accepted Solution

by:
Kinger247 earned 500 total points
ID: 17997695
I think the loop from the other thread is the reason.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17997808
I believe you're correct...thanx.
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17997819
If you need a loop, put all the code from LoadQuestion into a timer and start the timer from the form load event.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 17997874
?
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

718 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