Re: VB.NET how can i change color to a quoted text that goes in the cuteeditor??

  •  02-28-2010, 11:06 PM

    Re: VB.NET how can i change color to a quoted text that goes in the cuteeditor??

    Dear vagelis28,
     
    please refer to code:
    <%@ Page Language="vb"%>
    <%@ Register TagPrefix="cutesoft" TagName="banner" Src="banner.ascx" %>
    <%@ Register TagPrefix="cutesoft" TagName="leftmenu" Src="leftmenu.ascx" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
        <head>
      <title>JavaScript API</title>
      <link rel="stylesheet" href="../example.css" type="text/css" />
       <script language="JavaScript" type="text/javascript" >
        function ChangeColor()
       {
        // get the cute editor instance
        var editor1 = document.getElementById('<%=Editor1.ClientID%>');
        var cmd ="forecolor";
        var val = "red";
        editor1.ExecCommand(cmd, false, val);
        document.getElementById("<%= btnBusineeLogic.ClientID %>").click();
       }
      </script>
      <script runat="server">
      Overrides Protected  Sub OnInit(ByVal e As EventArgs)
        MyBase.OnInit(e)  
                Editor1.Text = "This is a test"
          End Sub
          Protected Sub btnBusineeLogic_Execute(ByVal sender As Object, ByVal e As EventArgs)
              'Text color has been changed, please put your own business logic code here
          End Sub
      </script>
     <body>
            <form id="Form1" runat="server">
       <cutesoft:banner id="banner1" runat="server" /> 
       <table cellpadding="15">
        <tr>
         <td id="leftcolumn" width="160">
          <cutesoft:leftmenu id="leftmenu1" runat="server" />    
         </td>
         <td>
          <h1>JavaScript API</h1>
          This example shows you how to use CuteEditor JavaScript API to customize the application.
          <br><br>
          <CE:Editor id="Editor1" Width="560" TemplateItemList="[Save,Bold,Italic,Underline,InsertChars,InsertEmotion]" ThemeType="OfficeXP" Height="250" EditorWysiwygModeCss="../example.css" runat="server"></CE:Editor><br />
          &nbsp;<br/><br/>         
          <p style="width:600">   
          <asp:Button ID="btnBusineeLogic" runat="server" Style="visibility: hidden" OnClick="btnBusineeLogic_Execute"  /> 
          <INPUT type=button value="ChangeColor" onclick="ChangeColor()">      
          </P>
          <br>
        </td>    
        </tr>
       </table> 
      </form>
     </body>
    </html>
     
    Regards,
    Eric
View Complete Thread