WinForm中Button的使用

2021-07-04 19:07

阅读:354

标签:mouse   back   comm   int   hit   str   size   siem   oid   

  • 自定义样式
    • 先要清除系统风格影响:this.FlatStyle = FlatStyle.Flat;
    • 位置:this.Location = new System.Drawing.Point(this.sidePadding + this.btnWidth, 0);
    • 大小:this.Size = new System.Drawing.Size(btnWidth, btnHeight);
    • 前景色:this.ForeColor = Color.White;
    • 背景色(字体颜色):this.BackColor = Color.FromArgb(35, 135, 170);
    • 背景图片:this.BackgroundImage = newGradientBackImg;
    • 字体:this.Font = new Font(GlobalParams.SiemensFontFamily, GlobalParams.FontSize, FontStyle.Bold, GraphicsUnit.Pixel, 1);
    • 边框
      • 清除:this.FlatAppearance.BorderSize = 0;
      • 颜色:this.FlatAppearance.BorderColor = Color.FromArgb(173, 190, 203);
  • 事件/效果
    • 悬停时显示手形鼠标
      • this.btnTabCommonData.Click += new EventHandler(btnTabCommonData_Click);

        private void btn_MouseEnter(object sender, EventArgs e)
        {
        ((Button)sender).Cursor = Cursors.Hand;
        }

          

WinForm中Button的使用

标签:mouse   back   comm   int   hit   str   size   siem   oid   

原文地址:https://www.cnblogs.com/wyp1988/p/9844550.html


评论


亲,登录后才可以留言!