Re: change toolbar image

  •  06-29-2009, 8:51 PM

    Re: change toolbar image

    Hi goh6613,
     
    Try this example
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <html>   
    5. <head>   
    6.     <title>Add custom buttons</title>   
    7. </head>   
    8.   
    9. <script runat="server">   
    10.     void Page_Load(object sender, System.EventArgs e)   
    11.     {   
    12.         CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"];   
    13.         if (tc != null)   
    14.         {   
    15.             System.Web.UI.WebControls.Image Image1 = new System.Web.UI.WebControls.Image();   
    16.             Image1.ToolTip = "Insert a layer";   
    17.             //put a image under the root of your site, and name tools.gif   
    18.             //if you want to use another path and name, just change Image1.ImageUrl   
    19.             Image1.ImageUrl = "tools.gif";   
    20.             Image1.CssClass = "CuteEditorButton";   
    21.             SetMouseEvents(Image1);   
    22.             Image1.Attributes["onclick"] = " CuteEditor_GetEditor(this).ExecCommand('InsertLayer')";   
    23.             tc.Control.Controls.Add(Image1);   
    24.         }   
    25.     }   
    26.   
    27.     void SetMouseEvents(WebControl control)   
    28.     {   
    29.         control.Attributes["onmouseover"] = "CuteEditor_ButtonCommandOver(this)";   
    30.         control.Attributes["onmouseout"] = "CuteEditor_ButtonCommandOut(this)";   
    31.         control.Attributes["onmousedown"] = "CuteEditor_ButtonCommandDown(this)";   
    32.         control.Attributes["onmouseup"] = "CuteEditor_ButtonCommandUp(this)";   
    33.         control.Attributes["ondragstart"] = "CuteEditor_CancelEvent()";   
    34.     }   
    35. </script>   
    36.   
    37. <body>   
    38.     <form id="Form1" runat="server">   
    39.         <CE:Editor ID="Editor1" EditorWysiwygModeCss="../example.css" Height="200" runat="server"  
    40.             TemplateItemList="Bold,Italic,Underline,JustifyLeft,JustifyCenter,JustifyRight,InsertUnorderedList,Separator,Indent, Outdent, insertcustombutonhere">   
    41.         </CE:Editor>   
    42.     </form>   
    43. </body>   
    44. </html>  

    Regards,
     
    ken
View Complete Thread