C#模仿office 2007的Ribbon风格

  • U3_875723
    了解作者
  • 629.8KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 1
    下载次数
  • 2022-04-08 02:27
    上传日期
1. 创建一个新的C# App 2. 在你的应用程序中添加所有的类 3. 重新编译你的项目 4. 在工具栏里就会看到好多的新控件了,如图 5. 在Form上添加一个Windows.Forms.Panel,并且dock to the top,调整大小及位置 6. 在Panel中添加TabStrip 7. 你可以通过TabStripPageSwitcher添加TabStrip. 如果很难点中,可以点击属性窗口。 8. 使用一个TabStrip和几个tab以及TabStrip页,在TabStripPages中添加TabPanels。 9. 在TabPanel里添加RibbonButton,调整图像和大小,暂时别担心文字的颜色,他们将在运行时处理。 10. 如果上面的都做好了,运行程序,就会看到类似下图的效果了: [自定义风格] 在代码示例中的Form1里的SetStyle方法: Code: 这样你就会发现,你只需要设置3个颜色,其余的都是这些颜色的求和或相减。 public void SetStyle(string Name) { Color HaloColor = Color.White; switch (Name) { case "Dark": this.BackColor = Color.FromArgb(88,77,69); HaloColor = Color.FromArgb(200,200,200); SetBase(87,61,53,HaloColor); break;...
Office2007RibbonPanel.rar
  • Office2007RibbonPanel.aspx_files
  • ads_data
  • ainw_000000.gif
    66B
  • abg-zh-CN-100c-000000.png
    1.1KB
  • article.css
    2.1KB
  • ga.js
    18.9KB
  • 2cc396c8-3456-48eb-8f7f-42ea5d0b048b.jpg
    4.9KB
  • 0fe7f1f0-0f53-4542-b247-f794fb079f1e.jpg
    10.7KB
  • msplogo.gif
    3.2KB
  • ads.htm
    7.9KB
  • show_ads.js
    16.8KB
  • main.css
    5.4KB
  • 37e8f95b-6254-4971-a3af-d399b438c08b.jpg
    21.1KB
  • 74e21e37-1ade-4ca3-91fa-389916a377e8.jpg
    28.6KB
  • Demo.zip
    118.5KB
  • CodeProject An easy way to add a Ribbon Panel Office 2007 style_ Free source code and programming help.mht
    487.9KB
  • Source.zip
    336.3KB
  • Office2007RibbonPanel.aspx.htm
    18.1KB
内容介绍
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><title>仿office 2007的Ribbon风格面板</title> <link rel="stylesheet" href="Office2007RibbonPanel.aspx_files/main.css" type="text/css"><link rel="stylesheet" href="Office2007RibbonPanel.aspx_files/article.css" type="text/css"><link rel="Shortcut Icon" href="http://www.msproject.cn/images/favicon.ico"><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><meta name="description" content="该控件模仿office 2007的Ribbon风格,显示操作面板。"><meta name="Keywords" content="office 2007 Ribbon 面板"></head><body> <form name="form1" method="post" action="Office2007RibbonPanel.aspx" id="form1"> <div> <input name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTI1NzE1NDI5OWRkFrErapRG0wxyvjlBH2dfVxqh0MU=" type="hidden"> </div> <div id="MainBody"> <table style="width: 100%;" cellpadding="0" cellspacing="0"> <tbody><tr> <td align="left"> <!-- here for logo --> </td> <td align="right"> <!-- here for AD --> <div id="AdOnTop"></div> </td> <td style="margin: 0px; width: 120px;"> <table width="100%"> <tbody><tr style="height: 10px;"><td align="right"><a style="" onclick="window.external.AddFavorite(location.href,document.title);" rel='nofollow' onclick='return false;'>加入收藏</a> </td></tr> <tr style="height: 10px;"><td align="right"><a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.msproject.cn/');return(false);" style="" rel='nofollow' onclick='return false;'>设为首页</a> </td></tr> <tr style="height: 10px;"><td align="right"><a href="mailto:wyjun1980@yahoo.com.cn" rel='nofollow' onclick='return false;'>联系我们</a></td></tr> </tbody></table> </td> </tr> </tbody></table> <!-- here for article categories --> <table class="NativeBar" cellpadding="0" cellspacing="0"> <tbody><tr style="height: 28px;"> <td> <a id="HyperLinkHome" title="MSProject开源技术主页" href="http://www.msproject.cn/default.aspx" rel='nofollow' onclick='return false;'>主页</a> </td> <td> <a id="HyperLinkCs" title="C#技术文章与源代码" href="http://www.msproject.cn/Category.aspx?Name=csharp" rel='nofollow' onclick='return false;'>C#</a> </td> <td> <a id="HyperLinkAsp" title="ASP.NET技术文章与源代码" href="http://www.msproject.cn/Category.aspx?Name=aspnet" rel='nofollow' onclick='return false;'>ASP.NET</a> </td> <td> <a id="HyperLinkVb" title="VB.NET技术文章与源代码" href="http://www.msproject.cn/Category.aspx?Name=vbnet" rel='nofollow' onclick='return false;'>VB.NET</a> </td> <td> <a id="HyperLinkCpp" title="MFC/C++技术文章与源代码" href="http://www.msproject.cn/Category.aspx?Name=vcnet" rel='nofollow' onclick='return false;'>MFC/C++</a> </td> <td> <a id="HyperLinkOther" title="其它技术文章" href="http://www.msproject.cn/Category.aspx?Name=other" rel='nofollow' onclick='return false;'>其它</a> </td> <td style="width: 60%;">&nbsp;</td> <td> <a href="http://www.msproject.cn/Search.aspx" title="搜索您想要的源代码或技术文章" rel='nofollow' onclick='return false;'>搜索资源</a> </td> <td> <!-- here for bbs link --> <a href="http://bbs.msproject.cn/" title="开源技术社区" rel='nofollow' onclick='return false;'>开源技术BBS社区</a> </td> </tr> </tbody></table> <!-- here for article categories --> <table id="MainContent" style="border: 0px solid black; width: 100%;" border="0" cellpadding="0" cellspacing="0"> <tbody><tr> <!-- middle --> <td id="MainContentMiddle"> <div> <div style="text-align: center;"> <br> <div id="spanArticleTitle" class="ArticleTitle">仿office 2007的Ribbon风格面板</div> <br> <div><span id="spanArticleAuthor" class="greenfont">zxjing</span><b>著于</b><span id="spanCreateDate">发表<b> 2007-7-18 </b></span></div> <div id="spanPlatform">C#,.NET 2.0</div> <div><span id="spanViews">阅读<b> 412 </b></span><span id="spanPosts">评论<b> 6 </b></span></div> </div> <br> <!-- Abstract of the Article --> <table id="ArticleTop" style="margin-left: 5px; width: 100%;" border="0" cellpadding="5" cellspacing="0"> <tbody><tr> <td style="color: Green;"> <span id="spanAbstract">该控件模仿office 2007的Ribbon风格,显示操作面板。</span> </td> </tr> </tbody></table> </div> <div id="divAdContentTop"> </div> <table style="width: 100%;" border="0" cellpadding="0" cellspacing="0"> <tbody><tr> <td> <div id="divArticleContent" class="ArticleContent"><h1>[翻译]</h1> <p><br> Juan Pablo G.C.. 著<a rel="nofollow" href="http://www.codeproject.com/cs/miscctrl/Ribbon_Panel.asp" rel='nofollow' onclick='return false;'>An easy way to add a Ribbon Panel Office 2007 style</a><br> <br> 该控件模仿office 2007的Ribbon风格,显示操作面板。<br> 此主题相关图片如下:</p> <h1>[RibbonStyle命名空间]</h1> <p><br> <strong>* <span style="color: brown;">RibbonButton</span>: <span style="color: brown;">Transparency</span>, Autosizable image, <span style="color: brown;">AutoForecolor</span>, <span style="color: brown;">AutoInfoForm </span>(see InfoForm, OnBackImage and ClickBackImage).<br> * <span style="color: brown;">TabPanel</span>: <span style="color: brown;">Transparency</span>, <span style="color: brown;">BaseColor</span>, <span style="color: brown;">BaseColorOn </span>(Highlighted), <span style="color: brown;">Caption</span>, <span style="color: brown;">Resizable</span>.<br> * <span style="color: brown;">TabStrip</span>: Has inside:<br> 1. <span style="color: brown;">Tab</span>: With <span style="color: brown;">Autowidth</span>, <span style="color: brown;">BaseColor</span>, <span style="color: brown;">HaloColor </span>and <span style="color: brown;">Enable </span>work.<br> 2. <span style="color: brown;">TabStripProffesionalRenderer</span>: Controls the Tab Style (hard to work)<br> 3. <span style="color: brown;">TabStripPage</span>: <span style="color: brown;">BaseColor</span>, inherits my <span style="color: brown;">RibbonPanel</span>.<br> 4. <span style="color: brown;">TabPageSwitcher</span>: Controls the link between <span style="color: brown;">Tab </span>and <span style="color: brown;">TabStripPage</span>. Design functionality as the <span style="color: brown;">tabcontrol</span>.<br> * <span style="color: brown;">InfoForm </span>(with Shadow): Depending on Title, Comment, and Image of Info.. Properties of <span style="color: brown;">RibbonButton </span>resizes itself.</strong></p> <p><strong></strong></p> <h1>[代码使用]</h1> <p><br> <strong>1. 创建一个新的C# App<br> 2. 在你的应用程序中添加所有的类<br> 3. 重新编译你的项目<br> 4. 在工具栏里就会看到好多的新控件了,如图<br> <br> <br> <br> <br> 5. 在Form上添加一个Windows.Forms.Panel,并且dock to the top,调整大小及位置<br> 6. 在Panel中添加TabStrip<br> 7. 你可以通过TabStripPageSwitcher添加TabStrip. 如果很难点中,可以点击属性窗口。<br> <br> <br> <br> <br> 8. 使用一个TabStrip和几个tab以及TabStrip页,在<span style="color: brown;">TabStripPages</span>中添加<span style="color: brown;">TabPanels</span>。<br> <br> 9. 在<span style="color: brown;">TabPanel</span>里添加<span style="color: brown;">RibbonButton</span>,调整图像和大小,暂时别担心文字的颜色,他们将在运行时处理。<br> <br> 10. 如果上面的都做好了,运行程序,就会看到类似下图的效果了:<br> <br> <img alt="image" src="Office2
评论
    相关推荐