Click or drag to resize
AceoffixCtrlAddCustomToolButton Method
Adds a button to custom toolbar.

Namespace: Aceoffix
Assembly: Aceoffix (in Aceoffix.dll) Version: 5.0.0.1
Syntax
public void AddCustomToolButton(
	string Caption,
	string JsFunction,
	int IconIndex
)

Parameters

Caption
Type: SystemString
The caption of new button item. If the caption is "-", means that this button item is separator.
JsFunction
Type: SystemString
The name of JavaScript function. The JavaScript function will be called when user clicks this button.
IconIndex
Type: SystemInt32

The index of button icon. Aceoffix predefines some button icons and you can use one of them. The default value is 0. Possible values as following:

Custom Toolbutton Icons

Remarks
Call this method to add each button. The click event of new button can be triggered by the specified JavaScript function.
Examples

The following code example shows how to use the AddCustomToolButton method.

AceoffixCtrl1.AddCustomToolButton("Save", "SaveDocument()", 1);
AceoffixCtrl1.AddCustomToolButton("Print", "ShowPrintDlg()", 6);
AceoffixCtrl1.AddCustomToolButton("-", "", 0);
AceoffixCtrl1.AddCustomToolButton("Switch Full-screen", "SwitchFullScreen()", 4);

And then, you should define the JavaScript functions in the aspx file of current page.

JavaScript
<script language="javascript" type="text/javascript">
    function SaveDocument() {
        document.getElementById("AceoffixCtrl1").SaveDocument();
    }
    function ShowPrintDlg() {
        document.getElementById("AceoffixCtrl1").ShowDialog(4); //Print dialog box
    }
    function SwitchFullScreen() {
        document.getElementById("AceoffixCtrl1").FullScreen = !document.getElementById("AceoffixCtrl1").FullScreen;
    }
</script>
See Also