473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Threads in Mdi form

Is it possible to use the main form which is the parent form in one thread
and all the other child forms in other threads, all of this in MDI vb.net
windows forms application ?
Thanks in advance,

Smallville
Dec 27 '05 #1
5 2372
"Smallville" <Sm********@discussions.microsoft.com> schrieb:
Is it possible to use the main form which is the parent form in one thread
and all the other child forms in other threads, all of this in MDI vb.net
windows forms application ?


No, both the MDI parent and the child forms must run in the same thread.
However, you could span additional threads which perform operations from
within the MDI container or its children.

Multithreading in Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 27 '05 #2
"Smallville" <Sm********@discussions.microsoft.com> schrieb
Is it possible to use the main form which is the parent form in one
thread and all the other child forms in other threads, all of this
in MDI vb.net windows forms application ?

No, if Forms have a child/parent/owner relation to each other, they must run
in the same thread.
Armin

Dec 27 '05 #3
Thanks!,
I will try to run one of my methods in another thread instead of running the
child form in another thread.
"Herfried K. Wagner [MVP]" wrote:
"Smallville" <Sm********@discussions.microsoft.com> schrieb:
Is it possible to use the main form which is the parent form in one thread
and all the other child forms in other threads, all of this in MDI vb.net
windows forms application ?


No, both the MDI parent and the child forms must run in the same thread.
However, you could span additional threads which perform operations from
within the MDI container or its children.

Multithreading in Windows Forms applications
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=multithreading&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 27 '05 #4
"Smallville" <Sm********@discussions.microsoft.com> schrieb:
I will try to run one of my methods in another thread instead of running
the
child form in another thread.


That's a good idea, because it will separate the presentation layer (UI)
from the layer which performs processing.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 27 '05 #5
SmallVille,

I am forever suprised for what people are using multithreading.

Does this mean that the user is typing in something in two forms or
something.

Can you give us an idea in what multithreading helps you in this.

Cor
"Smallville" <Sm********@discussions.microsoft.com> schreef in bericht
news:2B**********************************@microsof t.com...
Is it possible to use the main form which is the parent form in one thread
and all the other child forms in other threads, all of this in MDI vb.net
windows forms application ?
Thanks in advance,

Smallville

Dec 27 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Doug Thews | last post by:
I was noticing that when I run a multi-threaded app from within the IDE and then I close the main form (which spun off all of the threads), that the Stop/Pause VCR buttons in the debugger are still...
2
by: Adam Clauss | last post by:
OK, my main thread will create some number of other threads (number determined at runtime). Each of these threads creates a form via a call: private void ProcessThread() { Application.Run(new...
22
by: Jeff Louie | last post by:
Well I wonder if my old brain can handle threading. Dose this code look reasonable. Regards, Jeff using System; using System.Diagnostics; using System.IO; using System.Threading;
1
by: andreas.baus | last post by:
Hi. I'm trying to figure out how to properly start and stop threads from a windows form. One thing I still have a problem with is how to make sure the spawned thread(s) are shut down when the...
1
by: LordHog | last post by:
Hello all, I am a small application that I am developing which will use a few threads. When the user closes the form the threads will remain present until I close them. The Main Form...
14
by: Lior Amar | last post by:
Quick question about threads and delegates. I have the following scenario Thread A (CLASSA) spawns Thread B (CLASSB) and passes it a DelegateA to a callback Thread B Invokes a DelegateB...
10
by: Mark Denardo | last post by:
Hi, I have multi-threaded application that requires one particular thread (Non-Form based) to receive data from other threads. I know how to pass control to Form Threads, but I believe there's no...
15
by: Bryce K. Nielsen | last post by:
I have an object that starts a thread to do a "process". One of the steps inside this thread launches 12 other threads via a Delegate.BeginInvoke to process. After these 12 threads are launched,...
10
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005 and .net 2.0. I started 2 threadpool threads. How do I know when they're done with their tasks? Thanks. ThreadPool.QueueUserWorkItem(new...
9
by: thiago777 | last post by:
Question details: VB .NET / threads / events / GUI Imagine the following situation: A method from object "A" creates "n" threads. Variables from these threads contains values that should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.