Refresh-Problem on scrolling form with own control

M

Manfred Denzer

Hello!

I've written an own control: a picture button with a text below.
My class extends "Control" and overwrite the methode
"OnPaint(PaintEventArgs e)".
Here, a draw the image with "e.Graphics.DrawImage" and write the text
with "e.Graphics.DrawString".

Now, I used my control on many forms and it works very good.
But if my form is higher than my display and I scroll the form, my
control doesn't looks fine. It seems the display does not refresh fast
enought and the text becomes blurred. You can see the same text and
image directly over/below the original several times:
http://img370.imageshack.us/img370/1827/textrp2.jpg

The .NET standard-controls (Label, PictureBox, ComboBox, ...) are
working fine, so I think, I have an error in my Control.

Thank you very much for your help!
Manfred
 
S

Simon Hart [MVP]

I'm sure this question has been asked before to which I replied. The easiest
solution is deriving from UserControl not Control if using CF 2.0 or later.
 
M

Manfred Denzer

Thank you very much for your answer!
I try to derive from UserControl instead of Control, but I have still
the same effect :-(
Do you have another idea?
 
S

Simon Hart [MVP]

Can you please show us some code. I just tried that here and I don't get the
problem you are seeing.
 

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