Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: change toolbar image
Re: change toolbar image
06-29-2009, 8:51 PM
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: change toolbar image
Reply
Quote
Hi goh6613,
Try this example
<%@ Page Language=
"C#"
%>
<%@ Register TagPrefix=
"CE"
Namespace=
"CuteEditor"
Assembly=
"CuteEditor"
%>
<html>
<head>
<title>Add custom buttons</title>
</head>
<script runat=
"server"
>
void
Page_Load(
object
sender, System.EventArgs e)
{
CuteEditor.ToolControl tc = Editor1.ToolControls[
"insertcustombutonhere"
];
if
(tc !=
null
)
{
System.Web.UI.WebControls.Image Image1 =
new
System.Web.UI.WebControls.Image();
Image1.ToolTip =
"Insert a layer"
;
//put a image under the root of your site, and name tools.gif
//if you want to use another path and name, just change Image1.ImageUrl
Image1.ImageUrl =
"tools.gif"
;
Image1.CssClass =
"CuteEditorButton"
;
SetMouseEvents(Image1);
Image1.Attributes[
"onclick"
] =
" CuteEditor_GetEditor(this).ExecCommand('InsertLayer')"
;
tc.Control.Controls.Add(Image1);
}
}
void
SetMouseEvents(WebControl control)
{
control.Attributes[
"onmouseover"
] =
"CuteEditor_ButtonCommandOver(this)"
;
control.Attributes[
"onmouseout"
] =
"CuteEditor_ButtonCommandOut(this)"
;
control.Attributes[
"onmousedown"
] =
"CuteEditor_ButtonCommandDown(this)"
;
control.Attributes[
"onmouseup"
] =
"CuteEditor_ButtonCommandUp(this)"
;
control.Attributes[
"ondragstart"
] =
"CuteEditor_CancelEvent()"
;
}
</script>
<body>
<form id=
"Form1"
runat=
"server"
>
<CE:Editor ID=
"Editor1"
EditorWysiwygModeCss=
"../example.css"
Height=
"200"
runat=
"server"
TemplateItemList=
"Bold,Italic,Underline,JustifyLeft,JustifyCenter,JustifyRight,InsertUnorderedList,Separator,Indent, Outdent, insertcustombutonhere"
>
</CE:Editor>
</form>
</body>
</html>
Regards,
ken
View Complete Thread