Exemple #1
0
        private ToolStripItem CreateButton(IHTMLEditorButton toolbarItem)
        {
            var toolStripButton = new ToolStripButton();

            toolStripButton.DisplayStyle          = ToolStripItemDisplayStyle.Image;
            toolStripButton.Image                 = toolbarItem.IconImage;
            toolStripButton.ImageScaling          = ToolStripItemImageScaling.None;
            toolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
            toolStripButton.Name = toolbarItem.IconName;
            toolStripButton.Size = new System.Drawing.Size(25, 24);
            toolStripButton.Text = toolbarItem.IconTooltip;

            var args = new HTMLEditorButtonArgs();

            args.Document = _doc;
            args.Editor   = this;

            IHTMLEditorButton button = toolbarItem;

            toolStripButton.Click += (sender, o) => button.IconClicked(args);

            return(toolStripButton);
        }
Exemple #2
0
        private ToolStripItem CreateButton(IHTMLEditorButton toolbarItem)
        {
            var toolStripButton = new ToolStripButton();

            toolStripButton.DisplayStyle          = ToolStripItemDisplayStyle.Image;
            toolStripButton.Image                 = toolbarItem.IconImage;
            toolStripButton.ImageScaling          = ToolStripItemImageScaling.None;
            toolStripButton.ImageTransparentColor = Color.Magenta;
            toolStripButton.Name        = toolbarItem.IconName;
            toolStripButton.Size        = new Size(25, 24);
            toolStripButton.Text        = toolbarItem.IconTooltip;
            toolStripButton.MergeAction = MergeAction.Append;

            var args = new HTMLEditorButtonArgs {
                Document = this._doc, Editor = this
            };

            IHTMLEditorButton button = toolbarItem;

            toolStripButton.Click += (sender, o) => button.IconClicked(args);

            return(toolStripButton);
        }
Exemple #3
0
 public void AddToolbarItem(IHTMLEditorButton toolbarItem)
 {
     _customButtons.Add(toolbarItem);
     editcontrolsToolStrip.Items.Add(CreateButton(toolbarItem));
 }