Refresh-Problem on scrolling form with own control

  • Thread starter Thread starter Manfred Denzer
  • Start date Start date
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
 
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.
 
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?
 
Can you please show us some code. I just tried that here and I don't get the
problem you are seeing.
 
Back
Top