earthdance Posted April 9, 2006 Posted April 9, 2006 Hello, I hope someone can help me figure this out. I have coded an application that will send a mail message to a list of about 250 e-mail addresses. The program connects to a database in order to retrieve this list, then adds them to an Array and then goes through this erray to send the mail message to each address. This process works fine, but I wanted to have my program display in a label a message that shows the user what is the program doing at a certain point. For example: "Connecting to database..." "Retrieving list of addresses..." "Sending message to: address@email.com" etc.. The problem is that as soon as I click on the Submit button the program freezes all through the process and I am only able to see the last message when all the process is finished. Is there something that I am missing so that the program will actually preserve its flow and display all messages while going through the entire process? Any help will be appreciated. Quote
Leaders snarfblam Posted April 9, 2006 Leaders Posted April 9, 2006 Have you tried throwing in a call to Application.DoEvents after you update the label? Quote [sIGPIC]e[/sIGPIC]
earthdance Posted April 9, 2006 Author Posted April 9, 2006 Have you tried throwing in a call to Application.DoEvents after you update the label? No I haven't... does this have anything to do with Multi Threading? Quote
earthdance Posted April 9, 2006 Author Posted April 9, 2006 finally Application.Doevents() after changing the text of the label worked great. THANKS!!! :) Quote
Leaders snarfblam Posted April 9, 2006 Leaders Posted April 9, 2006 It basically passes CPU control around all the threads to let them do what they need to do. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.