Custom button in new toolbar with style

Last post 01-12-2006, 8:42 AM by hoirup. 2 replies.
Sort Posts: Previous Next
  •  01-12-2006, 4:02 AM 14635

    Custom button in new toolbar with style

    How can i create a custom button in a new toolbar and still have the mouse over select event. ?
     
    This i my .config file :
    ...
     <toolbars>
      <item type="g_start" />
      <item type="holder" name="insertcustombutonhere" />
      <item type="g_end" />
     </toolbars>
    ...

    I use the following code to add the button:
    Dim tc As CuteEditor.ToolControl
    tc = ED.ToolControls("insertcustombutonhere")
    If Not tc Is Nothing Then
     Dim Image1 As New System.Web.UI.WebControls.Image()
     Image1.ToolTip = ""
     Image1.ImageUrl = ImageURL & "textbox.gif"
     Image1.CssClass = "CuteEditorButton"
     Image1.Attributes("onclick") = "CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,'hello')"
     tc.Control.Controls.Add(Image1)
    End If

    But when i hold the mouse over the button the icon does not get the orange background.

    Regards
    Bo
     
  •  01-12-2006, 5:24 AM 14641 in reply to 14635

    Re: Custom button in new toolbar with style

    Bo,
     
    Please check the source code of vb/customization.aspx.

    Dim tc as CuteEditor.ToolControl
      
      tc = Editor1.ToolControls("insertcustombutonhere")
      
      If Not tc Is Nothing Then
       Dim Image1 As New System.Web.UI.WebControls.Image()
       Image1.ToolTip    = "Insert today's date"
       Image1.ImageUrl    = "tools.gif"
       Image1.CssClass    = "CuteEditorButton"
       SetMouseEvents(Image1)
       Image1.Attributes("onclick")="var d = new Date(); CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,d.toLocaleDateString())"
       tc.Control.Controls.Add(Image1)
      End If
     

     public Sub SetMouseEvents(ByVal control as WebControl )
      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()"
     End Sub

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-12-2006, 8:42 AM 14665 in reply to 14641

    Re: Custom button in new toolbar with style

    thanks ... that did the trick :)
     
    /Bo
View as RSS news feed in XML