コード例 #1
0
        /// <summary>
        /// 往幻灯片中添加按钮
        /// </summary>
        /// <param name="slide"></param>
        /// <param name="left"></param>
        /// <param name="top"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        private void AddSubmitOleForm(Slide slide, Single left, Single top, Single width, Single height, string buttonName, string shapeName)
        {
            var oleControl = slide.Shapes.AddOLEObject(left, top, width, height, "Forms.CommandButton.1", "",
                                                       MsoTriState.msoFalse, "", 0, "", MsoTriState.msoFalse).Name = shapeName;

            OLEFormat     oleF   = slide.Shapes[shapeName].OLEFormat;
            CommandButton button = (CommandButton)oleF.Object;

            button.BackColor = 92 + 173 * 256 + 255 * 256 * 256;
            button.ForeColor = 255 + 255 * 256 + 255 * 256 * 256;

            button.Caption  = buttonName;
            button.FontBold = true;
        }
コード例 #2
0
        private void AddSubmitOleForm1(Slide slide, Single left, Single top, Single width, Single height)
        {
            var oleControl = slide.Shapes.AddOLEObject(left, top, width, height, "Forms.CommandButton.1", "",
                                                       MsoTriState.msoFalse, "", 0, "", MsoTriState.msoFalse).Name = "sumbitButton";

            OLEFormat oleF = slide.Shapes["sumbitButton"].OLEFormat;

            MF.CommandButton button = (MF.CommandButton)oleF.Object;

            button.BackColor = 92 + 173 * 256 + 255 * 256 * 256;
            button.ForeColor = 255 + 255 * 256 + 255 * 256 * 256;

            button.Caption  = "发 布";
            button.FontBold = true;
            button.Click   += button_Click;
        }
コード例 #3
0
 /// <summary>
 /// Activate a MathType OLE object. This should be used in a <code>using</code> statement.
 /// </summary>
 /// <param name="oleFormat">OLE object from Microsoft Word</param>
 public MathTypeEquation(OLEFormat oleFormat)
 {
     oleFormat.DoVerb(2); // Activate MathType and update the equation object according to the current MathType version.
     oleObject  = oleFormat.Object as IOleObject;
     dataObject = oleObject as IDataObject;
 }