R
Roy Chastain
I have created a control that is based on Form. The Paint delegate code never gets called. Forms are new to me, so I probably
missed some important basic concept.
public class SplashForm: System.Windows.Forms.Form
{
protected override void OnLoad (EventArgs e)
{
this.Size = bitmap_to_be_clipped.Size;
this.Region = clipping_region;
this.BackgroundImage = bitmap_to_be_clipped;
} /* OnLoad */
private void PaintIt (object sender, PaintEventArgs e)
{
e.Graphics.DrawString("ProductName",font_product,
brush_product,pointf_product);
} /* PaintIt */
public SplashForm (Image the_image, Color transparent_color)
{
InitializeComponent();
this.Paint += newSystem.Windows.Forms.PaintEventHandler(this.PaintIt);
this.ResumeLayout(false);
.....
}
} /* end of class */
Then code that uses this does a
SplashForm splash = new SplashForm(image,color);
splash.Show();
I have tried invalidates on both sides of spash.Show to no avail.
Thanks for the advice
missed some important basic concept.
public class SplashForm: System.Windows.Forms.Form
{
protected override void OnLoad (EventArgs e)
{
this.Size = bitmap_to_be_clipped.Size;
this.Region = clipping_region;
this.BackgroundImage = bitmap_to_be_clipped;
} /* OnLoad */
private void PaintIt (object sender, PaintEventArgs e)
{
e.Graphics.DrawString("ProductName",font_product,
brush_product,pointf_product);
} /* PaintIt */
public SplashForm (Image the_image, Color transparent_color)
{
InitializeComponent();
this.Paint += newSystem.Windows.Forms.PaintEventHandler(this.PaintIt);
this.ResumeLayout(false);
.....
}
} /* end of class */
Then code that uses this does a
SplashForm splash = new SplashForm(image,color);
splash.Show();
I have tried invalidates on both sides of spash.Show to no avail.
Thanks for the advice