你是否厌倦了灰灰的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)
{

这篇博客介绍了如何在.NET Compact Framework中创建一个具有渐变背景色且支持透明标签的WINFORM。开发者需要继承Form,重写OnPaintBackground()方法,并利用MSDN提供的GradientFill.Fill方法来实现背景渐变效果。此外,还需要引入一个Win32Helper类以辅助实现所需功能。
最低0.47元/天 解锁文章
1724

被折叠的 条评论
为什么被折叠?



