Repainting Problem

D

Dino Buljubasic

HI,

I am having my user control on my form. My user control hosts a
custom build panel that gets dynamically loaded with ListView controls
when form is opened, maximized, resized.

ListViewItems of each Listview have their ForeColor properties
set to different colors and fonts.

All this works just fine. The problem occurs when I drag
another window (say I open Calculator and drag it over my form).

The problem is that when I drag the Calculator window (or any
other window) over my form, each ListViewItem ForeColor and Font does
not repaint properly (not every time).

It looks like it takes over the ForeColor and Font property of
my panel that hosts these ListViews. As I drag the other window over
my form, the Font and ForeColor of my ListViewItems get repainted
sometimes right way, sometimes not.

Also, if I drag another window over my form slowly, repainting
happens the right way.


How can I fix this?

Any holp will be appreciated,
_dino_
 
B

Bob Powell [MVP]

Are you doing the repainting correctly?

Have you read the #1 GDI+ FAQ problem?

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
D

Dino Buljubasic

For those interested, I have found out that this is rather an IDE
issue than coding issue. When I run my application from IDE, this
repainting problem occurs, when I run it from compiled .exe, the
problem is gone.

_dino_
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top