Windows Ribbon for WinForms,第9部分–更改功能区颜色

  • z5_904040
    了解作者
  • 215.6KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-03 17:40
    上传日期
在本文中,我将介绍如何更改色带颜色。
62510.zip
  • Windows-Ribbon-for-WinForms-Part-9-Changing-Ribbon.pdf
    92.7KB
  • windowsribbon09_src.zip
    97.8KB
  • windowsribbon09_demo.zip
    47.6KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/62716919d973ef42a44d5618/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/62716919d973ef42a44d5618/bg1.jpg"><div class="c x1 y1 w2 h2"><div class="t m0 x2 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">Win<span class="_ _0"></span>dow<span class="_ _0"></span>s R<span class="_ _0"></span>ibbo<span class="_ _0"></span>n fo<span class="_ _0"></span>r W<span class="_ _0"></span>inFo<span class="_ _0"></span>rms<span class="_ _0"></span><span class="ff2">&#65292;&#31532;<span class="_ _1"></span>&#65292;&#31532;<span class="_ _2"></span><span class="ff1">9</span>&#37096;<span class="_ _0"></span>&#20998;<span class="_ _1"></span>&#37096;&#20998;<span class="_ _2"></span><span class="ff1">&#8211;</span>&#26356;&#25913;&#21151;<span class="_ _0"></span>&#33021;<span class="_ _3"></span>&#26356;&#25913;<span class="_ _0"></span>&#21151;&#33021;</span></div><div class="t m0 x2 h3 y3 ff2 fs0 fc0 sc0 ls0 ws0">&#21306;&#39068;<span class="_ _0"></span>&#33394;<span class="_ _4"></span>&#21306;&#39068;<span class="_ _0"></span>&#33394;<span class="_ _2"></span><span class="ff1">-</span>&#28304;&#30721;<span class="_ _1"></span>&#28304;&#30721;</div><div class="t m0 x2 h4 y4 ff2 fs1 fc0 sc0 ls0 ws0">&#21151;&#33021;&#20171;<span class="_ _0"></span>&#32461;<span class="_ _4"></span>&#21151;<span class="_ _0"></span>&#33021;&#20171;&#32461;</div><div class="t m0 x2 h5 y5 ff2 fs2 fc0 sc0 ls0 ws0">&#25105;&#20170;&#22825;&#35201;<span class="_ _0"></span>&#35848;&#30340;&#21151;&#33021;<span class="_ _0"></span>&#26159;&#22914;&#20309;&#26356;&#25913;<span class="_ _0"></span>&#33394;&#24102;&#30340;&#24120;<span class="_ _0"></span>&#35268;&#39068;&#33394;&#12290;<span class="_ _0"></span><span class="ff3"> </span>&#35831;&#27880;&#24847;&#65292;&#24744;<span class="_ _0"></span>&#19981;&#33021;&#26356;&#25913;&#29305;<span class="_ _0"></span>&#23450;&#21151;&#33021;&#21306;<span class="_ _0"></span>&#39033;&#30446;&#30340;&#39068;<span class="_ _0"></span>&#33394;&#65292;&#21482;&#33021;&#26356;<span class="_ _0"></span>&#25913;&#25972;&#20010;&#21151;<span class="_ _0"></span>&#33021;&#21306;&#12290;</div><div class="t m0 x2 h5 y6 ff2 fs2 fc0 sc0 ls0 ws0">&#25105;&#20204;&#21487;&#20197;<span class="_ _0"></span>&#26356;&#25913;<span class="ff3">3</span>&#31181;&#39068;<span class="_ _0"></span>&#33394;&#65306;</div><div class="t m0 x1 h5 y7 ff2 fs2 fc0 sc0 ls0 ws0">&#32972;&#26223;&#39068;&#33394;</div><div class="t m0 x1 h5 y8 ff2 fs2 fc0 sc0 ls0 ws0">&#31361;&#20986;&#26174;&#31034;<span class="_ _0"></span>&#39068;&#33394;</div><div class="t m0 x1 h5 y9 ff2 fs2 fc0 sc0 ls0 ws0">&#25991;&#23383;&#39068;&#33394;</div><div class="t m0 x2 h5 ya ff2 fs2 fc0 sc0 ls0 ws0">&#36825;&#26159;&#19968;&#20010;<span class="_ _0"></span>&#24425;&#24102;&#30340;&#31034;<span class="_ _0"></span>&#20363;&#65306;</div><div class="t m0 x2 h4 yb ff2 fs1 fc0 sc0 ls0 ws0">&#24590;&#20040;&#20570;<span class="_ _0"></span>&#65311;<span class="_ _4"></span>&#24590;<span class="_ _0"></span>&#20040;&#20570;&#65311;</div><div class="t m0 x2 h5 yc ff2 fs2 fc0 sc0 ls0 ws0">&#25105;&#22312;<span class="ff3 fc1">Win<span class="_ _0"></span>dows Rib<span class="_ _0"></span>bon for W<span class="_ _0"></span>inForms<span class="_ _0"></span></span>&#24211;&#30340;<span class="_ _0"></span><span class="ff3 fs3">RibbonLib.R<span class="_ _0"></span>ibbon</span>&#31867;&#20013;<span class="_ _0"></span>&#28155;&#21152;&#20102;&#19968;<span class="_ _0"></span>&#20010;&#26032;&#26041;&#27861;&#12290;</div><div class="t m0 x2 h5 yd ff2 fs2 fc0 sc0 ls0 ws0">&#20197;&#19979;&#26159;&#22914;<span class="_ _0"></span>&#20309;&#20351;&#29992;&#23427;<span class="_ _0"></span>&#30340;&#31034;&#20363;&#65306;</div><div class="t m0 x2 h5 ye ff3 fs2 fc0 sc0 ls0 ws0">C<span class="ff2">&#65283;</span></div><div class="t m0 x2 h6 yf ff3 fs3 fc0 sc0 ls0 ws0"> private void<span class="_ _0"></span> Fo<span class="_ _0"></span>rm1_Load( <span class="_ _0"></span>object sen<span class="_ _0"></span>der, EventAr<span class="_ _0"></span>gs e)</div><div class="t m0 x2 h6 y10 ff3 fs3 fc0 sc0 ls0 ws0">{</div><div class="t m0 x2 h6 y11 ff3 fs3 fc0 sc0 ls0 ws0"> <span class="_ _0"></span>// i<span class="_ _0"></span>nit ribbon fra<span class="_ _0"></span>mework</div><div class="t m0 x2 h6 y12 ff3 fs3 fc0 sc0 ls0 ws0"> _ribbon<span class="_ _0"></span>.InitFramew<span class="_ _0"></span>ork( <span class="_ _0"></span>this<span class="_ _0"></span> );</div><div class="t m0 x2 h6 y13 ff3 fs3 fc0 sc0 ls0 ws0"> <span class="_ _0"></span>// s<span class="_ _0"></span>et ribbon co<span class="_ _0"></span>lors</div><div class="t m0 x2 h6 y14 ff3 fs3 fc0 sc0 ls0 ws0"> _ribbon<span class="_ _0"></span>.SetColors(C<span class="_ _0"></span>olor.Wheat,<span class="_ _0"></span> Color.Indian<span class="_ _0"></span>Red, Color.B<span class="_ _0"></span>lueViolet);</div><div class="t m0 x2 h6 y15 ff3 fs3 fc0 sc0 ls0 ws0">}</div><div class="t m0 x2 h4 y16 ff2 fs1 fc0 sc0 ls0 ws0">&#24149;&#21518;&#33457;<span class="_ _0"></span>&#32110;<span class="_ _4"></span>&#24149;<span class="_ _0"></span>&#21518;&#33457;&#32110;</div><div class="t m0 x2 h5 y17 ff3 fs3 fc0 sc0 ls0 ws0">SetColors<span class="_ _0"></span><span class="ff2 fs2">&#26041;&#27861;&#30340;&#23454;&#38469;<span class="_ _0"></span>&#20316;&#29992;&#26159;&#65306;</span></div><div class="t m0 x1 h5 y18 ff2 fs2 fc0 sc0 ls0 ws0">&#20174;<span class="ff3 fs3">IUIFram<span class="_ _0"></span>ework<span class="fs2"> </span></span>&#65288;&#20195;<span class="_ _0"></span>&#34920;&#21151;&#33021;&#21306;<span class="_ _0"></span>&#26694;&#26550;&#65289;&#33719;&#21462;<span class="_ _0"></span><span class="ff3 fs3">IPropertySto<span class="_ _0"></span>re</span>&#25509;&#21475;</div><div class="t m0 x1 h5 y19 ff2 fs2 fc0 sc0 ls0 ws0">&#21019;&#24314;<span class="ff3">3</span>&#20010;<span class="ff3 fs3">Pro<span class="_ _0"></span>pVariant</span>&#21464;&#37327;&#65292;<span class="ff3"> <span class="fs3">PropV<span class="_ _0"></span>ariant</span></span>&#21464;&#37327;&#23558;&#20445;&#30041;&#25105;<span class="_ _0"></span>&#20204;&#35201;&#35774;&#32622;&#30340;<span class="_ _0"></span><span class="ff3">3</span>&#31181;&#39068;&#33394;</div><div class="t m0 x1 h5 y1a ff2 fs2 fc0 sc0 ls0 ws0">&#36716;&#25442;&#39068;&#33394;<span class="_ _0"></span>&#65306;<span class="ff3">RGB &#8211;<span class="_ _0"></span>&gt; HSL &#8211;&gt;<span class="_ _0"></span> HSB &#8211;&gt; u<span class="_ _0"></span>int</span>&#65292;&#35831;&#21442;<span class="_ _0"></span>&#38405;&#19979;&#19968;&#37096;&#20998;</div><div class="t m0 x1 h5 y1b ff2 fs2 fc0 sc0 ls0 ws0">&#20351;&#29992;&#36716;&#25442;<span class="_ _0"></span>&#21518;&#30340;&#39068;&#33394;<span class="_ _0"></span>&#20540;&#35774;&#32622;&#30456;&#20851;<span class="_ _0"></span>&#23646;&#24615;</div><div class="t m0 x2 h5 y1c ff3 fs2 fc0 sc0 ls0 ws0">C<span class="ff2">&#65283;</span></div><div class="t m0 x2 h6 y1d ff3 fs3 fc0 sc0 ls0 ws0"> public void<span class="_ _0"></span> SetCo<span class="_ _0"></span>lors(Color ba<span class="_ _0"></span>ckground, C<span class="_ _0"></span>olor highligh<span class="_ _0"></span>t, Color text)</div><div class="t m0 x2 h6 y1e ff3 fs3 fc0 sc0 ls0 ws0">{</div><div class="t m0 x2 h6 y1f ff3 fs3 fc0 sc0 ls0 ws0"> <span class="_ _0"></span>if (_framewo<span class="_ _0"></span>rk == <span class="_ _0"></span>null<span class="_ _0"></span> )</div><div class="t m0 x2 h6 y20 ff3 fs3 fc0 sc0 ls0 ws0"> {</div><div class="t m0 x2 h6 y21 ff3 fs3 fc0 sc0 ls0 ws0"> retu<span class="_ _0"></span>rn ;</div><div class="t m0 x2 h6 y22 ff3 fs3 fc0 sc0 ls0 ws0"> }</div><div class="t m0 x2 h6 y23 ff3 fs3 fc0 sc0 ls0 ws0"> </div><div class="t m0 x2 h6 y24 ff3 fs3 fc0 sc0 ls0 ws0"> IProper<span class="_ _0"></span>tyStore pro<span class="_ _0"></span>pertyStore =<span class="_ _0"></span> (IPropertyS<span class="_ _0"></span>tore)_frame<span class="_ _0"></span>work;</div><div class="t m0 x2 h6 y25 ff3 fs3 fc0 sc0 ls0 ws0"> PropVa<span class="_ _0"></span>riant backgr<span class="_ _0"></span>oundColorPr<span class="_ _0"></span>op = <span class="_ _0"></span>new Pro<span class="_ _0"></span>pVariant();</div><div class="t m0 x2 h6 y26 ff3 fs3 fc0 sc0 ls0 ws0"> PropVa<span class="_ _0"></span>riant highligh<span class="_ _0"></span>tColorProp <span class="_ _0"></span>= ne<span class="_ _0"></span>w PropV<span class="_ _0"></span>ariant();</div><div class="t m0 x2 h6 y27 ff3 fs3 fc0 sc0 ls0 ws0"> PropVa<span class="_ _0"></span>riant textCol<span class="_ _0"></span>orProp = new Pr<span class="_ _0"></span>opVariant();</div><div class="t m0 x2 h6 y28 ff3 fs3 fc0 sc0 ls0 ws0"> <span class="_ _0"></span>uint backgro<span class="_ _0"></span>undColor =<span class="_ _0"></span> ColorHelper<span class="_ _0"></span>.HSB2uint(</div></div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐