For my application im making "Toast" like alerts. Im using an override method on the forms "Paint" event to create a custom gradient. The form then has a picture box, and 3 labels on it, all with transparent backgrounds. On XP, the background of these controls are being set to the form's original background color, and the images / text not being displayed.
On windows 7:
On Windows XP:
My Paint method:
private void AlertForm_Paint(object sender, PaintEventArgs e)
{
using (LinearGradientBrush brush = new LinearGradientBrush(
this.ClientRectangle,
Color.Black,
Color.DimGray,
120F))
{
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
}
Does anyone have any advice to fix the issues on windows XP please?
UPDATE: Here is the source code to my form, minus design code: http://pastebin.com/RUYtM7qu
FIXED: I have found the issue to be due to the animation of the form. If i just show the form, it displays fine, but as soon as i move it, the text and icon disapear. I decided to register for the "LocationChanged" event, and manually call this.Refresh()" on the form, and that fixed the problem!