Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Allowing code to continue to execute


Reply
 
Thread Tools Display Modes
  #1  
Old 07-09-2012, 03:18 AM
fartil3 fartil3 is offline
Newcomer
 
Join Date: Jul 2012
Posts: 1
Question Allowing code to continue to execute


Hello all, This is my first post and first time here... really hope you can help me.

I have created an application that calls on external dll files. This works fine. What I would like to do is create a form (dialogue window) that pops up, not allowing the user to use the main form while the dll executes. The dll opens another program and sends data back to the original form.

I can create another form, open it etc.. but the code waits until it's closed b4 moving on to the actual execution of the dll...

Is there anyway I can open the dialogue that says "waiting for X program to finish" ?
Reply With Quote
  #2  
Old 07-10-2012, 07:48 AM
dwwolfe dwwolfe is offline
Newcomer
 
Join Date: Dec 2011
Posts: 3
Default

I think you may have to disable any input controls on the main form, too. Users might still be able to move the pop-up window and make changes on the main form.
Reply With Quote
  #3  
Old 07-10-2012, 08:59 AM
AtmaWeapon's Avatar
AtmaWeapon AtmaWeapon is offline
Fabulous Florist

Forum Leader
* Guru *
 
Join Date: Feb 2004
Location: Austin, TX
Posts: 9,415
Default

gg67, please don't respond to .NET questions with VB6 code. There's a legacy forum for VB6 discussion.

fartil3:
A thread can only do one thing at a time. Multiple forms can appear to be doing multiple things on the same thread because of the "message pump", a mechanism they use to receive input events. When you display a dialog, the calling form's message pump is suspended. That's why displaying a dialog "disables" the parent form. So I imagine your code looks like this:
Code:
Dim waitDialog As New YourWaitDialog()
waitDialog.ShowDialog()

DoStuff()
What you'd /like/ is for DoStuff() to happen while the dialog is displayed. Unfortunately that's impossible with a single thread. You need to look into using something like the BackgroundWorker component to do your work on another thread while the dialog is displayed.
__________________
.NET Resources
My FAQ threads | Tutor's Corner | Code Library
I would bet money 2/3 of .NET questions are already answered in one of these three places.
Reply With Quote
  #4  
Old 07-10-2012, 10:15 AM
gg67 gg67 is offline
Newcomer
 
Join Date: Oct 2003
Posts: 3
Default

Quote:
Originally Posted by AtmaWeapon View Post
gg67, please don't respond to .NET questions with VB6 code. There's a legacy forum for VB6 discussion.
Sorry. Deleted
Reply With Quote
Reply

Tags
dialogue, forms


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->