473,664 Members | 2,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Diagnost ics 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 4762
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************* *@exisconsultin g.com

"Joey Powell" <jo*********@go ldcoinc.com> wrote in message
news:bd******** *************** ***@posting.goo gle.com...
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.Diagnost ics 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 "WaitForExi t" 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************ **@exisconsulti ng.com> wrote in message news:<Ok******* *******@TK2MSFT NGP09.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************* *@exisconsultin g.com

"Joey Powell" <jo*********@go ldcoinc.com> wrote in message
news:bd******** *************** ***@posting.goo gle.com...
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.Diagnost ics 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 "WaitForExi t" 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************ **@exisconsulti ng.com> wrote in message
news:<Ok******* *******@TK2MSFT NGP09.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************* *@exisconsultin g.com

"Joey Powell" <jo*********@go ldcoinc.com> wrote in message
news:bd******** *************** ***@posting.goo gle.com...
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.Diagnost ics 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********@stu dent.tul.edu> wrote in message
news:%2******** ********@TK2MSF TNGP09.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 "WaitForExi t" 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************ **@exisconsulti ng.com> wrote in message
news:<Ok******* *******@TK2MSFT NGP09.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************* *@exisconsultin g.com

"Joey Powell" <jo*********@go ldcoinc.com> wrote in message
news:bd******** *************** ***@posting.goo gle.com...
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.Diagnost ics 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
1335
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 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...
0
1291
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 it's hard to pass the Graphics object throught the component hierarchy because no public method takes an PaintEventArgs object or Graphics object. Invalidate, Repaint and so on all seem to get their Graphics object from nowhere (ok, after reading...
4
15578
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 web based project so it has to work on the web. And the important is as the user slides the control the graph will change itself. How can I get c# to draw a graph on a website depending on the slide controls postion. thanks coskunc
4
1937
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 from the toolbar). System.Windows.Forms.ControlPaint.DrawCheckBox(e.Graphics, tempRectangle, Windows.Forms.ButtonState.Checked) It's draw in a cell within a grid. I use an AddHandler function to call a function (Call it Function X) when the...
4
3147
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 further away, completely leaving the selector box area. Any ideas? VS 2003 and VB.Net This is a simple application at the moment but the form is inherited from a
6
5604
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 Vista when this mode is set, the control is all one color indicating that you can't type in it and looks really slick. How do i reproduce this behavior?
6
595
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 process is outside my domain - I can rely on the file being updated when data changes. Within my domain is the design of a Windows service to perform the operations required when the data changes. I have not produced a Windows service before...
3
8122
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 distractions, but even these make a big diference. I use access 2003 on Win XP I also realize that such pictures cause the application to bloat much. But after zipping it is reduced back to a small size so it can be transmitted across the net.
2
7003
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 methods Ive tried...is there a trick? Any information or examples would be greatly appreciated. Thanks! Ron
0
8348
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
8861
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
8778
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...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6187
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
4351
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2764
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
2003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1759
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.