Problems with OnPaintBackground and/or OnPaint

C

Carsten Unterberg

Hey everyone,

I have got a strange problem with the .Net Compact Framework v.3.5, Forms
and Controls.

In this case, I've got an formular with an overwritten OnPaintBackground
function where the base function is not called.

In my version of the OnPaintBackground, I create a bitmap with the size of
1x1 pixel, define the color of the pixel and draw it stretched to the form's
background. Everything seems to be ok. In an other version, I've a gradient
bitmap with the size of 480*2 pixel and I draw it to the form's background
stretched to a size of 480x536. Everything seems to be ok as well.

But when I have an other control like a button or a listview on the form,
and the control is to close to the right and/or bottom border of the form,
the form's background would not be draw correct. The form's background will
not be draw correctly from the top position of the control to to bottom
border of the parent form and from the left position of the control to the
right border of the parent form.

Does anyone know that strange behavior of .Net Compact Framework v.3.5, how
can fix it of could it be a bug?

Best regards,

Carsten Unterberg
Test-Framework | http://test-framework.blogspot.com/
 
C

Christopher Fairbairn [MVP]

Hi Carsten,

Are you able to share any sample source code (such as your OnPaintBackground
implementation) to demonstrate your problem?

A number of people have implemented custom background painting within their
applications and I am not aware of any significant issues with its use
within .NET CF 3.5. This leads me to think it may be something application
specific rather than a framework bug.

Hope this helps,
Christopher Fairbairn
 

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