473,394 Members | 1,951 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,394 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 4746
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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
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
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.