change toolbar image

Last post 06-30-2009, 3:36 AM by goh6613. 4 replies.
Sort Posts: Previous Next
  •  06-28-2009, 11:18 PM 53573

    change toolbar image

    hi
     
    how can i replace the toolbar image with my own image ?
     
    thanks
  •  06-29-2009, 7:47 AM 53583 in reply to 53573

    Re: change toolbar image

    Hi goh6613,
     
    You can create a custom button to do the same function and use your own image.
     
    Demo
     
     
    Regards,
     
    Ken
  •  06-29-2009, 7:44 PM 53610 in reply to 53583

    Re: change toolbar image

    hi
     
    if i want to remain the toolbar function, but just want to change the image,
     
    is it possible ? and how can i do that ?
     
    I trying to change "Insert Layer" image, can someone help me in this ?
     
    thanks
  •  06-29-2009, 8:51 PM 53612 in reply to 53610

    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
  •  06-30-2009, 3:36 AM 53623 in reply to 53612

    Re: change toolbar image

    thanks kenneth
View as RSS news feed in XML