473,406 Members | 2,217 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,406 software developers and data experts.

Modeless Form not repainting

I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port). Everything seems to be working correctly (I don't get any errors), but no results are displayed in the window. If I move the window it is not repainting itself, so I am sure that that is the problem, but I don't know how to fix it. Can someone give me a point in the right direction?

Thanks,

Phil
Nov 16 '05 #1
2 2160
When you create the form, pass in a reference to a form that is definatley
on the GUI thread, I usually use the first form in the application. Then use
control invoke to call the update method something like the following:

//do your data stuff here
appParentForm.Invoke(new EventHandler(updateThisForm));
public void updateThisForm( Object sender, EventArgs e)
{
this.Invalidate();
}

"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port).
Everything seems to be working correctly (I don't get any errors), but no
results are displayed in the window. If I move the window it is not
repainting itself, so I am sure that that is the problem, but I don't know
how to fix it. Can someone give me a point in the right direction?
Thanks,

Phil

Nov 16 '05 #2
When you create the form, pass in a reference to a form that is definatley
on the GUI thread, I usually use the first form in the application. Then use
control invoke to call the update method something like the following:

//do your data stuff here
appParentForm.Invoke(new EventHandler(updateThisForm));
public void updateThisForm( Object sender, EventArgs e)
{
this.Invalidate();
}

"Phil" <Ph**@discussions.microsoft.com> wrote in message
news:31**********************************@microsof t.com...
I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port).
Everything seems to be working correctly (I don't get any errors), but no
results are displayed in the window. If I move the window it is not
repainting itself, so I am sure that that is the problem, but I don't know
how to fix it. Can someone give me a point in the right direction?
Thanks,

Phil

Nov 16 '05 #3

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

Similar topics

8
by: vince | last post by:
I have a windows app whose main dialog contains a button that launches a form. I've tried using Form.Show() to have it launch as a modeless form, but it behaves as if it's modal (i.e. parent form...
0
by: Phil | last post by:
I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port). Everything seems to be working correctly (I don't get any...
0
by: Andrew | last post by:
I get a Null Reference Exception if I close a modeless form (that is, a form displayed using Show()) when a selection is made from a ComboxBox. If the form is modal (displayed using ShowDialog())...
6
by: Gary Miller | last post by:
Does anyone know how to detect a modeless form on closing by the form that invoked the modeless form? form.Show();
2
by: Legendary Pansy | last post by:
Hello, I'm trying to accomplish the impossible by trying to do something equivalent of this example found here http://www.c-sharpcorner.com/Code/2003/Dec/DialogTutorial.as Starting with "Listing...
1
by: andrew | last post by:
Hi there, I'm having a problem with a modeless form in my app. I have a main form in my app and a socket that waits on data from a server (I use BeginReceive/EndReceive for that) and when I...
2
by: proit_123 | last post by:
I am working on a windows forms application and have the following requirement. · I need to display a modeless dialog from the main form. o This allows user to continue to work with the...
8
by: proit_123 | last post by:
I am working on a windows forms application and have the following requirement. I have two projects in my application Project A and Project B. And Project A has the reference of Project B. I...
3
by: DoB | last post by:
What is the preferred way to refresh modeless dialogs? I am using the modeless dialog that shows a progress of a sequential process. The dialog class has nonvisual properties containg the...
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
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
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
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...
0
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
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...

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.