473,624 Members | 2,213 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 5167
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******@poczt a.onet.pl> schrieb im Newsbeitrag
news:e3******** ********@tk2msf tngp13.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...Window s 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******@poczt a.onet.pl> wrote in message
news:e3******** ******@tk2msftn gp13.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
1650
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 everything on a test machine, I get an unusual error in a message box: (Title) MyApp.exe - Common Language Runtime Debugging Services (Body) Application has generated an exception that could
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 ... then try to make the form visible on child thread 2 .. However, the form will not display either on child thread 2 or "parent thread" ... Any idea why this is? Please help DT
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
2145
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 : System.Windows.Forms.Control { private System.Windows.Forms.TextBox Calculation;
5
6578
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 it, the main windows form would still be running in the background and never terminating. How can I terminate the old window form from the new created window. I hope someone out there understands my problem.
0
1058
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. Here's my issue that I posted in another forum, but nobody has answered: I'm creating a Windows form application in VC++ .NET 2003. I'm creating the UI is a nested namespace as follows: namespace MyApplication {
9
1947
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 the appropriate session cookie already. After logging in on that page successfully they are given the cookie and redirected back to the page they initially tried to go to. I would like to create a Windows application that gets data from that...
0
1244
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 created a form with a button, textbox and NumericUpDown. Textbox holds the message to be displayed on the newly created form and the NumericUpDown allows for set of delay. I have this working to a fashion but my new form (frm) is not fully...
1
1548
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 XSD.EXE, is that perhaps what I need?
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8174
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8624
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8478
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6111
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4082
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1485
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.