SpiceLogic .NET Win HTML Editor Control
Online Documentation.

Skip Navigation Links.

Customizing Factory Toolbar Items - programmatically

Although the properties of the factory toolbar items can be manipulated from design time GUI Collection editor, yet those items can be accessed publicly to modify the value of their various properties in the run time.

Example 1:

You want to change the image of the factory shipped Bold Button and also you want to set the display style for this button as ImageAndText.


Solution:

Within your Form's Load event handler, place the following snippet as shown:




Example 2:

By default, when the Open button is clicked from the toolbar, a OpenFileDialog is shown to the user to select a file to load. You can override this behaviour. You dont want to show the OpenFileDialog, rather you want to load a file directly to the editor. Solution:
This control comes with 3 events for overriding the click event of 'New Button', 'Open Button' and 'Save Button'. The events are , 'NewButtonClicked', 'OpenButtonClicked' and 'SaveButtonClicked' respectively. So, what you need to do is simply handle the OpenButtonClicked Event and add your code in the event handler method as shown here.



It is important to be familiar with the ToolStripItem prototypes for accessing them programmatically.
Toolbar Item prototypes Associated public Methods
Usage: htmlEditor1.Operations.MethodName()
public ToolStripButton _factoryBtnNew public void ClearContents()
public ToolStripButton _factoryBtnOpen public void LoadExternalFile()
public void LoadExternalFile(string OpenFileDialogTitle)
public ToolStripButton _factoryBtnSave public void SaveBodyHtmlToFile()
public void SaveBodyHtmlToFile(string SaveFileDialogTitle)
public ToolStripComboBox _factoryCmbFontName public void ChangeFontName(string fontName)
public SLFontToolStripNumericUpDown _factoryNumericUpDownFontSize public void ChangeFontSize(int fontSize)
public ToolStripButton _factoryBtnCut public void Cut()
public ToolStripButton _factoryBtnCopy public void Copy()
public ToolStripButton _factoryBtnPaste public void Paste()
public ToolStripButton _factoryBtnPrint public void Print(bool ShowDialog)
public ToolStripButton _factoryBtnBold public void Bold()
public ToolStripButton _factoryBtnItalic public void Italic()
public ToolStripButton _factoryBtnUnderline public void Underline()
public ToolStripButton _factoryBtnHighlightColor public void ApplyFontHighlightColor()
public ToolStripButton _factoryBtnFontColor public void ApplyFontForeColor()
public void ApplyFontForeColor(Color fontForeColor)
public ToolStripButton _factoryBtnHyperLink public void HyperLink()
public ToolStripButton _factoryBtnImage public void insertImage()
public ToolStripButton _factoryBtnOrderedList public void InsertOrderedLis()
public ToolStripButton _factoryBtnUnorderedList public void InsertUnOrderedList()
public ToolStripButton _factoryBtnAlignLeft public void JustifyLeft()
public ToolStripButton _factoryBtnAlignCenter public void JustifyCenter()
public ToolStripButton _factoryBtnAlignRight public void JustifyRight()
public ToolStripButton _factoryBtnTable public void InsertTableDialog()
public ToolStripButton _factoryBtnOutdent public void Outdent()
public ToolStripButton _factoryBtnIndent public void Indent()
public ToolStripButton _factoryBtnBodyStyle public void SetBodyStyleWithDialog()
public ToolStripButton _factoryBtnHorizontalRule public void InsertHorizontalRule()
public ToolStripButton _factoryBtnRedo public void Redo()
public ToolStripButton _factoryBtnUndo public void Undo()
public ToolStripButton _factoryBtnSpellCheck public void CheckSpelling()
Usage: htmlEditor1.CheckSpelling()
public ToolStripButton _factoryBtnFormatReset public void FormatReset()
public ToolStripButton _factoryBtnStrikeThroughStrike public void StrikeThrough()
public ToolStripButton _factoryBtnSubscript public void Subscript()
public ToolStripButton _factoryBtnSuperScript public void Superscript()
public ToolStripButton _factoryBtnEditSource public bool EditSource{get;set;}
public ToolStripCombo _factoryCmbTitleInsert public bool TitleInsert(int headerNumber)