OnPaintBackground not called on a form

N

neemarr

On a smartphone (C#, Compact Framework 2 SP1) project and trying to
add a background image to my form. So I do override the
OnPaintBackground method and the method is never called. I tried to do
an invalidate on the OnActivated event but...even if I add an event
handler for the OnPaint event, that even handler won't get called
either.

Can somebody tell me what I need to do so that method gets called, or
is there another way to display the image in my forms background.
 
N

neemarr

The solution was one of those why did I spend a whole day trying to
figure out somethign so simple.

I had a control (a listview in this case) that had its Dock property
set to DockStyle.Fill, well there is no background to paint when there
is something that is taking over the entire frame.
 

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