|
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace WinDemoControls
{
public class BackGround : UserControl
{
public BackGround()
{
// Nothing to do here
}
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e);
LinearGradientBrush brush = new LinearGradientBrush(
e.ClipRectangle, Color.DarkSlateGray, Color.DarkGray, 60);
e.Graphics.FillRectangle(brush, e.ClipRectangle);
e.ClipRectangle.Inflate(50, 50);
brush = new LinearGradientBrush(
e.ClipRectangle, Color.WhiteSmoke, Color.LightGray, 60);
e.Graphics.DrawString(
base.ParentForm.Text + " is working...",
base.Font, brush, e.ClipRectangle);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.