Hi.
I've created a form which uses controls with transparent edges. The
problem I'm now facing is that the cleverness of the .net Compact
framework makes sure that the background (The form area beneath the
control) isn't drawn since it believes that this won't be visible. This
results in the rather interesting, but ugly, result that the
transparent areas of the control shows whatever was visible in the
background when the app was launched.
Is there any way of forcing a form to repaint itself completely? Including the areas it assumes won't be visible?
Loading
Thomas SamuelsenPosted Jan 29, 2009, 3:04 AM
I'm overriding the OnPaint methods of the form and the transparent control and letting the framework handle the calling of these.
But I actually found a solution to this. By creating a graphics object for the form using it's CreateGraphics method instead of using the one you can fetch from the paintEventArgs you avoid this optimizing clipping. And by making sure that the transparent buttons are hidden while the background is drawn then I'm sure the background is properly drawn. Then I show the buttons thereby forcing them to be repainted on top of this complete background and thus getting the desired result.
Jan MontanoPosted Jan 27, 2009, 4:44 AM
Creating transparent Windows Forms controls.