|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Showing Form in New Thread?Hi
I have a Form that on Form_Load() does some heavy database reading and I want to show that as a progressbar ontop of the main window.. I want to create a smaller Form with a progressbar.. and then in the main form, start a new thread that opens that small form and for each progress the heavy operation send a new value to the small form thru an event. I have managed to run a function or a sub in another thread but I can't figure out how to load a whole window in a new thread and keep sending new messages to it? Working with VB.NET and framework 1.1 best regards/ Lars Netzel Lars,
The best to do this is to create and update the progress bar form in the main UI thread. The worker thread will use Invoke or BeginInvoke from an existing Form to marshal the execution of a delegate onto the UI thread to accomplish this. Brian Lars Netzel wrote: Show quoteHide quote > Hi > > I have a Form that on Form_Load() does some heavy database reading and I > want to show that as a progressbar ontop of the main window.. > > I want to create a smaller Form with a progressbar.. and then in the main > form, start a new thread that opens that small form and for each progress > the heavy operation send a new value to the small form thru an event. > > I have managed to run a function or a sub in another thread but I can't > figure out how to load a whole window in a new thread and keep sending new > messages to it? > > Working with VB.NET and framework 1.1 > > best regards/ > Lars Netzel Idealy you should not be calling Window functions from anything but the
main AppDomain thread. You should call Invoke on any form control or by getting the AppDomain thread object. You then need to Invoke a function that will launch the Dialog. You can signal to the Dialog using the same method. Lars Netzel wrote: Show quoteHide quote > Hi > > I have a Form that on Form_Load() does some heavy database reading and I > want to show that as a progressbar ontop of the main window.. > > I want to create a smaller Form with a progressbar.. and then in the main > form, start a new thread that opens that small form and for each progress > the heavy operation send a new value to the small form thru an event. > > I have managed to run a function or a sub in another thread but I can't > figure out how to load a whole window in a new thread and keep sending new > messages to it? > > Working with VB.NET and framework 1.1 > > best regards/ > Lars Netzel
how do you use Class to hold global variables?
VB.NET Datagrid with pictures VB equivalent of this C# code Writing Data In Tabular format in Text File. What framework is running in this scenario? VBNET2005 : Manipulating MS Access tabledefinitions in VB.NET -> Create, Copy and Drop Table. db connections and text boxes Arrow on a button control User controls in VS 2005 .NET FrameWork 1.1 Winform DataGrid |
|||||||||||||||||||||||