473,443 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Create 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 5151
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
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
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
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
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
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
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
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
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.