在Ribbon中使用自定义图像。

来源:互联网 发布:手机淘宝怎么修改折扣 编辑:程序博客网 时间:2024/05/17 05:01

实现环境:Visual Studio 2010, Office 2010, VSTO 4.0

<?xml version="1.0" encoding="UTF-8"?><customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">  <ribbon>    <tabs>      <tab idMso="TabAddIns">        <group id="MyGroup"               label="ExcelTemplate1">          <button id="Test1" label ="Test1" getImage ="GetImage" size ="large"/>        </group>      </tab>    </tabs>  </ribbon></customUI>

        public Bitmap GetImage(Office.IRibbonControl Control)        {            switch(Control.Id)            {                case "Test1":                    return new Bitmap(Properties.Resources.Image1);                default :                    return new Bitmap(Properties.Resources.Image1);            }        }


原创粉丝点击