473,499 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating and displaying windows form in thread

Hi

I've got a problem. I try to create new WindowsForm in thread and show them.
Everything is ok, but new form after Show() freeze :(

Maybe somebody tell me why and how to fix this error.

Jul 19 '05 #1
2 5154
Hi,

you know, there some restrictions when using multithreading in a windows
forms application; i think only the thread which created a control may call
methods of this control; any other thread may only call the methods Invoke,
BeginInvoke, and EndInvoke which are marshalled to the control-owning
thread. You can test the a thread if these asycnronous calls are required by
testing the control property InvokeRequired.

I hope this helps,

Walter
"cube" <ch******@poczta.onet.pl> schrieb im Newsbeitrag
news:e3****************@tk2msftngp13.phx.gbl...
Hi

I've got a problem. I try to create new WindowsForm in thread and show them. Everything is ok, but new form after Show() freeze :(

Maybe somebody tell me why and how to fix this error.

Jul 19 '05 #2
You need to start a message pump on the thread...Windows pumps the first few
messages for you, which is what shows the window.

private void ThreadProc() {
Form f = new Form();
Application.Run(f);
}

--

Please do not reply to this alias directly. This posting is provided "AS
IS" with no warranties, and confers no rights. You assume all risk for your
use. © 2002 Microsoft Corporation. All rights reserved.
"cube" <ch******@poczta.onet.pl> wrote in message
news:e3**************@tk2msftngp13.phx.gbl...
Hi

I've got a problem. I try to create new WindowsForm in thread and show them. Everything is ok, but new form after Show() freeze :(

Maybe somebody tell me why and how to fix this error.

Jul 19 '05 #3

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

Similar topics

1
1637
by: Jeff | last post by:
I've been working on an app that has the usual Application.Run(new MyForm()) call in the static void Main (). I can run this executable when I run it on my development machine, but when I install...
2
324
by: Dayne | last post by:
Briefly this is my problem . I created a windows form on a "parent thread" .. then I called a child thread 1 to make it visible then hide it on that same thread .. then kill child thread 1 ......
2
311
by: cube | last post by:
Hi I've got a problem. I try to create new WindowsForm in thread and show them. Everything is ok, but new form after Show() freeze :( Maybe somebody tell me why and how to fix this error.
0
2132
by: Sinisa | last post by:
I have a Windows form which has multiple groups of the same window controls. I wanted to create a control class that has the standard controls in one. something like: public class Sensor :...
5
6567
by: Xarky | last post by:
Hi, I am creating a windows form, and when a specified event occurs (button click), I am hiding the windows form and opening a new windows form. When opening the new windows form and closing...
0
1052
by: rmacias | last post by:
I'm getting annoyed in that it has been over 30 minutes and none of my messages are being posted by the Web based news reader, so I'm using Outlook Express in hopes that this messages gets posted. ...
9
1942
by: Justin Engelman | last post by:
Hi, I have a website that uses an ISAPI filter that will redirect anyone going to any page on the site to an SSL login page (on a different website with the same root domain) if they do not have...
0
1234
by: Phil G. | last post by:
Hi, my 'project' requires that I create a form with text info. at set time periods. These time periods are not evenly spaced so I pass a param for the delay(seconds). In order to debug this I have...
1
1537
by: Jeroen | last post by:
Does anyone have a good starting point or bookmark for creating a windows form that allows inputting a xml according to a known schema? PS. For now, I'm still with Studio 2003. I have found the...
0
7128
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
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7215
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...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5467
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
294
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.