473,670 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET winforms redraw problem

13 New Member
I am using .net 2.0 and working in VS2005.
I've noticed following unpleasant effect in the standard Form class
behaviour: when the Form is hovered by some other window, it is being redrawn very slowly.

Here is the example. I have taken empty form, put there some standard controls:
http://www.ljplus.ru/img4/b/o/boshetunmaj/Redraw2.jpg

My hardware conf is: p4 3200, 2 Gb ram, GeForce 5200.
Mar 12 '08 #1
24 3253
SEngel
13 New Member
I have found that controls redraw at this moment takes up to 80% of CPU time...
Mar 13 '08 #2
Plater
7,872 Recognized Expert Expert
I have never had that occurance unless my computer is super bogged down with a lot of applications.
Might I suggest checking your windows theme/style settings? The P4 might not be able to hand it if you have a LOT of controls on your windows.
Mar 13 '08 #3
SEngel
13 New Member
I have never had that occurance unless my computer is super bogged down with a lot of applications.
Might I suggest checking your windows theme/style settings? The P4 might not be able to hand it if you have a LOT of controls on your windows.
It's strange, but there are only few controls. The most noticable effect is for TextBoxes, ComboBoxes and GroupBoxes.
Which one setting do you mean?
Mar 14 '08 #4
Plater
7,872 Recognized Expert Expert
Hmm, I turn off most of the themeing on my computer so I'm not sure it even has any bearing on it.

Are you doing anything else with the form? Doing anything durring paint/redraw events? Or populating data from a database or anything?
Mar 14 '08 #5
SEngel
13 New Member
Hmm, I turn off most of the themeing on my computer so I'm not sure it even has any bearing on it.

Are you doing anything else with the form? Doing anything durring paint/redraw events? Or populating data from a database or anything?
The form is free from any code.

I have set DoubleBuffered property of groupboxes to true and this helped a little, but the problem still stays.
Mar 15 '08 #6
SEngel
13 New Member
I have found the following effect:
I create multi window app (I run another window in another thread) and catch
events concerning moving and resizing of that other window. On each such event I run DoEvents() in a main thread. This leads to perferct window redraw.

But I can't understand, how to do the same with windows of 3rd side applications.
Can anybode help?
Mar 18 '08 #7
Plater
7,872 Recognized Expert Expert
Ah!
So this window was not running in the GUI thread but in a different thread?
Mar 18 '08 #8
SEngel
13 New Member
Ah!
So this window was not running in the GUI thread but in a different thread?

Yes, I've created BackgroundWorke r in the main GUI thread and asked it to do
Run.Application (AnotherWindow) ;

In this case I've no such awful effect as it was described in the 1st post.
That's because I can catch events from this window.
Mar 18 '08 #9
Plater
7,872 Recognized Expert Expert
I thought you were having trouble with the "main" window. Makes sense that the window in the other thread had trouble with redraws.
Mar 18 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1294
by: PHH | last post by:
Help me, please, When I redraw a ListviewItem in Listview (redraw items with icon and text columms). I used SetStyle(ControlStyle.UserPaint, true) function. And I redraw finish and run program, when I run program I choose first line (line with index = 0) but this line is not actived (draw border over that), after I click to another control (ex: other Listview, button ...) then this line is redrew border around. Only first line (first...
0
1902
by: WHITETIGER | last post by:
Help me, please, When I redraw a ListviewItem in Listview (redraw items with icon and text columms). I used SetStyle(ControlStyle.UserPaint, true) function. And I redraw finish and run program, when I run program I choose first line (line with index = 0) but this line is not actived (draw border over that), after I click to another control (ex: other Listview, button ...) then this line is redrew border around. Only first line (first...
2
3485
by: ch424 | last post by:
Hi, Does anybody know the fastest way to trigger a DrawingArea redaw in pygtk? At the moment, I'm using a bit of a hack: def redraw(self): self.area.hide() self.area.show() Is there a better way to trigger a redraw? This causes flickering when
1
3352
by: kiplring | last post by:
I wrote a program which draw a dancer at cornor of desktop. ( I Accessed through hDC) But It has a problem. I remains all trait at the desktop until I invoke any Redraw( Refresh) action - click, or drag. Is there any way invoke Redraw or Refresh a region of desktop? It should refresh all the window at the region. ( ex) explorer window.) Thanks.
1
3670
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I have to problems concerning datagrids, tabcontrols and scrollbars: 1) I created a form with a TabControl. This TabControl has two TabPages: the first with a datagrid to browse database records and the second with some controls (TextBoxes, OptionButtons...) to edit these records. When the second tab is shown and I use the DataGrid's SetDataBind method, the grid scrollbars are disabled.
5
4078
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in both projects. Both controls(dlls) have been signed using SN.exe and I've set up the appropriate .Net assembly permissions using those Strong Names The DLL's have been copied to the /bin directory in both web virtual directories.
0
2585
by: Dean Earley | last post by:
Hi all. I have just added translucency to one of my applications using the layered windows API, but I have come across a redraw problem. Unfortunately, I cant reproduce this in a standalone app but I'll try and explain what's happening. When a form is obscured when it is resized or made "visible" (I show some other forms on restore), it seems to remember that visibility
2
13066
by: diogoko | last post by:
I have some code like: try { someButton.disabled = true; cpuIntensiveCode(); } finally { someButton.disabled = false; } The problem is that someButton is never disabled, because the browser
8
1191
by: Spockman | last post by:
Hi Guys! I stuck in this problem quiet awhile. I have a MainForm in my application. It contains a second one as a member. If both a visible I have a problem to redraw the second one. eg: MainForm and SecondForm is open and I move another window over the SecondForm. After that I click on the MainForm it will get the Focus and it will be redrawn. But the SecondForm stays behind. I tried the following: Using the OnActivation or OnEnter of...
23
4521
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I memorize and/ or familiarize myself in WinForms will disappear in WPF? I did note in one early version of C#, the non-generic "ArrayList" was replaced by the generic and template <based List, but that kind of change is not a big deal. If WPF...
0
8471
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
8388
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
8907
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
8663
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...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
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...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2804
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
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.