背景渐变
来源:互联网 发布:算账软件用哪个 编辑:程序博客网 时间:2024/05/15 02:08
关键词: 背景渐变、重写OnPaintBackground方法。
GradientFill class and the Win32Helper class可以在这找到
The first thing I started with was to create a gradient background.I found that the best way achieving this would be to override OnPaintBackground in the Screen class. I found a very good article on how to do this on MSDN: How to display a gradient fill. I copied the GradientFill class and the Win32Helper class into my project, I didn’t bother using the GradientFilledButton class since I only needed gradient for my background.
Then I override the OnPaintBackground in my Screen, giving me this Form:
- 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)
- {
- GradientFill.Fill(
- e.Graphics, ClientRectangle,
- Color.Silver, Color.LightBlue,
- GradientFill.FillDirection.LeftToRight);
- e.Graphics.Dispose();
- }
- }
- }
This is what my simple Form with Gradient background looks like
参考资料:
http://www.cnblogs.com/chy710/archive/2009/09/15/1567210.html
http://breathingtech.com/2009/creating-gradient-background-with-transparent-labels-in-net-compact-framework/
- 背景渐变
- 背景渐变
- 渐变背景
- 渐变背景
- 背景渐变
- 背景渐变
- Android 背景渐变 渐变背景 shape
- 表格背景的渐变
- css 背景渐变,投影
- 渐变背景设计
- css 背景渐变
- 网页渐变背景
- 弹出提示 背景渐变
- CSS 背景渐变
- 实现背景渐变功能
- 渐变色背景
- 渐变色背景框架
- 对话框背景渐变色
- Oracle 常用函数总结
- 关于gtk中GList的发现
- 服务器×××上的MSDTC不可用解决办法
- ASX的播放列表格式
- flex特效
- 背景渐变
- struts2
- 取treeview中checkbox的值
- sed实现直接修改文件内容
- sql server 的 money类型
- 虚拟机VMWARE新功能
- Linux文件查找命令find,xargs详述
- MS-SQL Server字符串处理函数大全
- hibernate 设置默认值