472,982 Members | 2,175 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Windows Forms - How Can I Make Them Draw/Render Properly?

Hello all. For a long time now I have been struggling with a .net
Windows Forms problem. In several of my applications, I use the
"Process" class from System.Diagnostics to accomplish various task
from within my code (kind of like the old VB shell function). Using
this process class appears to be just one example of what causes my
Windows forms to look really crazy when running the application. In
fact this has become not only a cosmetic issue but also a usability
issue as of late. Users are confused because the application is not
updating or appears to be not responding.

More specifically, when I say that the forms look crazy what I mean
is, that quite frequently:

* The forms will draw white and not update for several minutes.

* My application will have two or three windows open in the Windows
taskbar when there should only be one.

It's as if there is a lot of processing waiting to occur but it can't
for some reason (maybe because the app is tied up working with the
shelled processes?) Even then, though, it doesn't update between the
processes! It doesn't update between the processes, even though (in
despiration) I have included numerous calls to the form's "Activate",
"Show", and "Refresh" functions.

I am tired of this causing problems. I would really like to know what
I can do to prevent it from happening in the future. Somebody once
told me it had something to do with threading, but I don't know about
that. Does anyone have any suggestions on what I should do?
Nov 15 '05 #1
4 4730
Joey,

This is not a Windows Forms issue. Rather, this is probably an issue
about how you are instantiating the Process and calling Start on it. First,
the call should be on another thread, so that it does not interfere with the
responsiveness of the app. Second, how are you making the call?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Joey Powell" <jo*********@goldcoinc.com> wrote in message
news:bd**************************@posting.google.c om...
Hello all. For a long time now I have been struggling with a .net
Windows Forms problem. In several of my applications, I use the
"Process" class from System.Diagnostics to accomplish various task
from within my code (kind of like the old VB shell function). Using
this process class appears to be just one example of what causes my
Windows forms to look really crazy when running the application. In
fact this has become not only a cosmetic issue but also a usability
issue as of late. Users are confused because the application is not
updating or appears to be not responding.

More specifically, when I say that the forms look crazy what I mean
is, that quite frequently:

* The forms will draw white and not update for several minutes.

* My application will have two or three windows open in the Windows
taskbar when there should only be one.

It's as if there is a lot of processing waiting to occur but it can't
for some reason (maybe because the app is tied up working with the
shelled processes?) Even then, though, it doesn't update between the
processes! It doesn't update between the processes, even though (in
despiration) I have included numerous calls to the form's "Activate",
"Show", and "Refresh" functions.

I am tired of this causing problems. I would really like to know what
I can do to prevent it from happening in the future. Somebody once
told me it had something to do with threading, but I don't know about
that. Does anyone have any suggestions on what I should do?

Nov 15 '05 #2
Nichlolas I am pretty sure that the processes are not on separate
threads...how does one do that anyway? You see, it's important that
app fire the processes syncronously - one can not run until the one
before it has finished...you know what I mean. That why I am using the
"Start" function along with the "WaitForExit" function of the process
class. I also call the "Dispose" function for each after I am
completely finished with the process. Now how can one accomplish the
syncronous processing while keeping the GUI updating properly?

"Nicholas Paldino [.NET/C# MVP]" <ni**************@exisconsulting.com> wrote in message news:<Ok**************@TK2MSFTNGP09.phx.gbl>...
Joey,

This is not a Windows Forms issue. Rather, this is probably an issue
about how you are instantiating the Process and calling Start on it. First,
the call should be on another thread, so that it does not interfere with the
responsiveness of the app. Second, how are you making the call?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Joey Powell" <jo*********@goldcoinc.com> wrote in message
news:bd**************************@posting.google.c om...
Hello all. For a long time now I have been struggling with a .net
Windows Forms problem. In several of my applications, I use the
"Process" class from System.Diagnostics to accomplish various task
from within my code (kind of like the old VB shell function). Using
this process class appears to be just one example of what causes my
Windows forms to look really crazy when running the application. In
fact this has become not only a cosmetic issue but also a usability
issue as of late. Users are confused because the application is not
updating or appears to be not responding.

More specifically, when I say that the forms look crazy what I mean
is, that quite frequently:

* The forms will draw white and not update for several minutes.

* My application will have two or three windows open in the Windows
taskbar when there should only be one.

It's as if there is a lot of processing waiting to occur but it can't
for some reason (maybe because the app is tied up working with the
shelled processes?) Even then, though, it doesn't update between the
processes! It doesn't update between the processes, even though (in
despiration) I have included numerous calls to the form's "Activate",
"Show", and "Refresh" functions.

I am tired of this causing problems. I would really like to know what
I can do to prevent it from happening in the future. Somebody once
told me it had something to do with threading, but I don't know about
that. Does anyone have any suggestions on what I should do?

Nov 15 '05 #3
That's what Nicolas was trying to say.
Because you call WaitForExit you're blocking the thread from updating the
GUI.
That's why you have to run these tasks on a different threads. Running it on
a different thread has nothing to do with accomplishing tasks in a specific
synchronious order. You can still do this, just on a different thread.

Greetz,
-- Rob.

Joey Powell wrote:
Nichlolas I am pretty sure that the processes are not on separate
threads...how does one do that anyway? You see, it's important that
app fire the processes syncronously - one can not run until the one
before it has finished...you know what I mean. That why I am using the
"Start" function along with the "WaitForExit" function of the process
class. I also call the "Dispose" function for each after I am
completely finished with the process. Now how can one accomplish the
syncronous processing while keeping the GUI updating properly?

"Nicholas Paldino [.NET/C# MVP]"
<ni**************@exisconsulting.com> wrote in message
news:<Ok**************@TK2MSFTNGP09.phx.gbl>...
Joey,

This is not a Windows Forms issue. Rather, this is probably an
issue
about how you are instantiating the Process and calling Start on it.
First,
the call should be on another thread, so that it does not interfere
with the
responsiveness of the app. Second, how are you making the call?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Joey Powell" <jo*********@goldcoinc.com> wrote in message
news:bd**************************@posting.google.c om...
Hello all. For a long time now I have been struggling with a .net
Windows Forms problem. In several of my applications, I use the
"Process" class from System.Diagnostics to accomplish various task
from within my code (kind of like the old VB shell function). Using
this process class appears to be just one example of what causes my
Windows forms to look really crazy when running the application. In
fact this has become not only a cosmetic issue but also a usability
issue as of late. Users are confused because the application is not
updating or appears to be not responding.

More specifically, when I say that the forms look crazy what I mean
is, that quite frequently:

* The forms will draw white and not update for several minutes.

* My application will have two or three windows open in the Windows
taskbar when there should only be one.

It's as if there is a lot of processing waiting to occur but it
can't
for some reason (maybe because the app is tied up working with the
shelled processes?) Even then, though, it doesn't update between the
processes! It doesn't update between the processes, even though (in
despiration) I have included numerous calls to the form's
"Activate", "Show", and "Refresh" functions.

I am tired of this causing problems. I would really like to know
what
I can do to prevent it from happening in the future. Somebody once
told me it had something to do with threading, but I don't know
about
that. Does anyone have any suggestions on what I should do?

Nov 15 '05 #4
Have a look at my article on codeproject.com
http://www.codeproject.com/useritems/LaunchProcess.asp

and also this really good article on threading and UI's
http://msdn.microsoft.com/msdnmag/is...g/default.aspx
--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com


"Rob Tillie" <Ro********@student.tul.edu> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
That's what Nicolas was trying to say.
Because you call WaitForExit you're blocking the thread from updating the
GUI.
That's why you have to run these tasks on a different threads. Running it on a different thread has nothing to do with accomplishing tasks in a specific synchronious order. You can still do this, just on a different thread.

Greetz,
-- Rob.

Joey Powell wrote:
Nichlolas I am pretty sure that the processes are not on separate
threads...how does one do that anyway? You see, it's important that
app fire the processes syncronously - one can not run until the one
before it has finished...you know what I mean. That why I am using the
"Start" function along with the "WaitForExit" function of the process
class. I also call the "Dispose" function for each after I am
completely finished with the process. Now how can one accomplish the
syncronous processing while keeping the GUI updating properly?

"Nicholas Paldino [.NET/C# MVP]"
<ni**************@exisconsulting.com> wrote in message
news:<Ok**************@TK2MSFTNGP09.phx.gbl>...
Joey,

This is not a Windows Forms issue. Rather, this is probably an
issue
about how you are instantiating the Process and calling Start on it.
First,
the call should be on another thread, so that it does not interfere
with the
responsiveness of the app. Second, how are you making the call?
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Joey Powell" <jo*********@goldcoinc.com> wrote in message
news:bd**************************@posting.google.c om...
Hello all. For a long time now I have been struggling with a .net
Windows Forms problem. In several of my applications, I use the
"Process" class from System.Diagnostics to accomplish various task
from within my code (kind of like the old VB shell function). Using
this process class appears to be just one example of what causes my
Windows forms to look really crazy when running the application. In
fact this has become not only a cosmetic issue but also a usability
issue as of late. Users are confused because the application is not
updating or appears to be not responding.

More specifically, when I say that the forms look crazy what I mean
is, that quite frequently:

* The forms will draw white and not update for several minutes.

* My application will have two or three windows open in the Windows
taskbar when there should only be one.

It's as if there is a lot of processing waiting to occur but it
can't
for some reason (maybe because the app is tied up working with the
shelled processes?) Even then, though, it doesn't update between the
processes! It doesn't update between the processes, even though (in
despiration) I have included numerous calls to the form's
"Activate", "Show", and "Refresh" functions.

I am tired of this causing problems. I would really like to know
what
I can do to prevent it from happening in the future. Somebody once
told me it had something to do with threading, but I don't know
about
that. Does anyone have any suggestions on what I should do?


Nov 15 '05 #5

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

Similar topics

0
by: Joey Powell | last post by:
Hello all. For a long time now I have been struggling with a .net Windows Forms problem. In several of my applications, I use the "Process" class from System.Diagnostics to accomplish various task...
0
by: Jan Kopcsek | last post by:
Hello, is there a way to draw Windows.Forms components into a specified surface (a D3DSurface for example)? i want to fill a texture with the graphics and render it to the screen. it looks like...
4
by: Coskun Cavusoglu | last post by:
Hi I need to build something that works like the following example http://www.realestateabc.com/calc_v22/calculator.html How can can I do this by using c# and web forms. It will be a part of a...
4
by: Joe Kasta | last post by:
Here's a tricky question..:) I have a a function in a webform that will draw a checkbox in a given area (note, this is an override of a PaintForeground function, not a drop / drag of a checkbox...
4
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps...
6
by: Nathan Laff | last post by:
Why when I inherit a ComboBox and make no code changes, when I set the new control DropDownStyle to dropDownList it appears different than the standard ComboBox control on Vista? In Windows...
6
by: Chris Marsh | last post by:
All I have a database table, changes to the data within which I am interested in acting on. The approach that I'm taking is to have the database update a file every time data is updated. This...
3
by: giladp1 | last post by:
Hi, I noticed that by adding background pictures to my forms the application looks so much more interesting and professional. I want to keep just texture simple backgrounds in order to prevent...
2
by: RSH | last post by:
I have been experimenting with overriding the Paint event on Win Form controls...more specifically trying to force the text to render as Antialiased text. I have not been successful in any of the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.