本文共 1148 字,大约阅读时间需要 3 分钟。
关键词: 背景渐变、重写OnPaintBackground方法。
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: . 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 :
This is what my simple Form with Gradient background looks like
参考资料:
本文转自xyz_lmn51CTO博客,原文链接:http://blog.51cto.com/xyzlmn/819926,如需转载请自行联系原作者