• 渐变色背景


    1、实现渐变色背景

     1  private void Form1_Paint(object sender, PaintEventArgs e)
     2         {
     3             Paint_Background(this.Left,this.Width,this.Height, e);
     4         }
     5 
     6         private void Paint_Background(int Left, int Width, int Height, PaintEventArgs e)
     7         {
     8             Rectangle r = new Rectangle(Left, 0, Width, Height);
     9             System.Drawing.Drawing2D.LinearGradientBrush brush =
    10                 new System.Drawing.Drawing2D.LinearGradientBrush(
    11                     r, 
    12                     Color.FromArgb(175, 210, 255),                                //颜色1
    13                     Color.White,                                                  //颜色2
    14                     System.Drawing.Drawing2D.LinearGradientMode.Vertical);
    15             e.Graphics.FillRectangle(brush, e.ClipRectangle);
    16         }
  • 相关阅读:
    C++基础学习6:内联函数
    lvm
    yum源
    mysql性能优化
    PXE
    dns配置
    进程命令
    ssh免密登陆和加密解密
    RAID阵列
    快速部署postfix邮件服务器
  • 原文地址:https://www.cnblogs.com/xiaochun126/p/4164937.html
Copyright © 2020-2023  润新知