zoukankan      html  css  js  c++  java
  • C# 自定义颜色

    一、需要引用

    using System.Windows.Media;

    二、 自定义颜色

        通过自定义 RGB 的值来达到自定义颜色的目的

    Color _Mycolor = Color.FromRgb(58, 157, 82);                  //默认透明度为255;Red=58, Green=157, Blue=82
    Color _Mycolor2 = Color.FromArgb(255, 58, 200, 100);          //透明度=255 ,Red=58, Green=200, Blue=100
     SolidColorBrush myBrush = new SolidColorBrush(_Mycolor);     //定义纯色绘制 变量
    SolidColorBrush myBrush2 = new SolidColorBrush(_Mycolor2);    //定义纯色绘制 变量 

    三、 应 用
    l    

    ab_Result.Foreground = myBrush;          //为控件字体指定 自定义 的颜色
    
     lab_Result.Background = myBrush2;       //指定背景颜色 
  • 相关阅读:
    ReportViewer,RDLC 报表开发之分页
    Mvc2.0 处理自定义错误.
    使用 WPS中粘贴VS里的代码,并整理格式
    Sql2008中添加程序集.
    快速整理列说明.SQL2008.
    ASP.NET MVC在IIS6下部署的小技巧
    MS SQL Server将数据导出Insert语句的存储过程
    在IE6下发生Internet Explorer cannot open the Internet site错误
    Windows7 中配置IIS7的方法(HTTP 错误 404.3 Not Found)
    安卓2.2手动开启APP2SD方法
  • 原文地址:https://www.cnblogs.com/fengyie55/p/3417576.html
Copyright © 2011-2022 走看看