Control creation and OnPaint

D

Dave

Hi all,

I'm creating a control derived from System.Windows.Forms.Control
I override the OnPaint() function
The control takes place on a form with a background image.
Because I've some problems to draw properly my control, I decided to test it
with a OnPaint() function which does *absolutely nothing*. And I'm very
surprised : I don't understand why the control seems to draw itself !? I get
a rectangle filled with the background color of the window... Why ? The
OnPaint function does absolutely nothing...

Am I missing something ?

Thanks in Advance.

(And sorry for my poor englih)

Dave

*****************************************

peace of code :

protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
}

With VB.Net, I think it's omething like this :

Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
End Sub

--> You see, the OnPaint function does absolutely nothing ;-)
 

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