你是否厌倦了灰灰的WINFORM呢,今天介绍一个为WINFORM填充渐变颜色的方法。参考了以下两篇文章
http://msdn.microsoft.com/en-us/library/ms229655(VS.80).aspx
新的WINFORM要继承Form,然后重写OnPaintBackground()方法
using System.Drawing;
using System.Windows.Forms;
namespace GradientTransparentTest
{
public partial class GradientTransparentForm : Form
{
public GradientTransparentForm()
{
InitializeComponent();
}
// Paints the background of the form with a GradientFill pattern.
protected override void OnPaintBackground(PaintEventArgs e)