zoukankan      html  css  js  c++  java
  • winfrom绘制渐变 / 调用浏览器访问指定地址

    private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
    {//绘制渐变色背景
    Graphics g = e.Graphics;
    System.Drawing.Drawing2D.LinearGradientBrush MyBrush =new System.Drawing.Drawing2D.LinearGradientBrush(
    this.ClientRectangle,Color.Black, Color.Yellow,
    System.Drawing.Drawing2D.LinearGradientMode.Vertical);
    g.FillRectangle(MyBrush, this.ClientRectangle);
    
    }
    
    private void Form1_Resize(object sender, System.EventArgs e)
    {//缩放窗口时更新背景
    this.Refresh();
    }
    

      

    效果图:

    调用浏览器访问指定地址:

            private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
            {
                 System.Diagnostics.Process ps = new System.Diagnostics.Process();
                 System.Windows.Forms.LinkLabel linkLabel = (System.Windows.Forms.LinkLabel)sender;
                 ps.StartInfo.FileName = "iexplore.exe";
                 ps.StartInfo.Arguments = linkLabel.Text;
                 ps.Start();
            }
    

      

  • 相关阅读:
    Jquery+ajax+bootstrap
    Js+Jquery
    css(2)+JS
    css
    mysql 高级
    Git
    Redis
    Nginx
    python爬虫 | 一条高效的学习路径
    拉勾网爬取全国python职位并数据分析薪资,工作经验,学历等信息
  • 原文地址:https://www.cnblogs.com/wxylog/p/7344965.html
Copyright © 2011-2022 走看看