﻿Imports System
Imports System.Data
Partial Class TestJJRichTextBox
    Inherits System.Web.UI.UserControl
    Public _Text As String = ""
    Public Property Text() As String
        Get
            Return _Text
        End Get
        Set(ByVal value As String)
            _Text = value
        End Set
    End Property




    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not IsPostBack Then

            tdAttributes()
            hfExisting.Value = Me.Text
        End If


        'Dim dt As DataTable
        'Dim total As Integer = 0
        'Dim i As Integer
        'For i = 0 To dt.Rows.Count - 1
        '    If i = dt.Rows.Count - 1 Then
        '        dt.Rows(i).Item("asdas") = i
        '    Else
        '        i = CType(dt.Rows(i).Item("asdas").ToString, Integer)
        '        i = i + i
        '    End If


        'Next


    End Sub
    Public Sub tdAttributes()


        imgBold.Attributes.Add("onmouseover", "imgMouseOver(this,'bold.over.gif');")
        imgBold.Attributes.Add("onmouseout", "imgMouseOut(this,'bold.gif');")
        imgBold.Attributes.Add("onclick", "imgBoldClick('" & frmTxtArea.ClientID.ToString & "');")

        imgItalic.Attributes.Add("onmouseover", "imgMouseOver(this,'italic.over.gif');")
        imgItalic.Attributes.Add("onmouseout", "imgMouseOut(this,'italic.gif');")
        imgItalic.Attributes.Add("onclick", "imgItalicClick('" & frmTxtArea.ClientID.ToString & "');")

        imgUnderLine.Attributes.Add("onmouseover", "imgMouseOver(this,'Underline.over.gif');")
        imgUnderLine.Attributes.Add("onmouseout", "imgMouseOut(this,'Underline.gif');")
        imgUnderLine.Attributes.Add("onclick", "imgUnderLineClick('" & frmTxtArea.ClientID.ToString & "');")

        ddlFontSize.Attributes.Add("onchange", "ddlFontSizeClick(this,'" & frmTxtArea.ClientID.ToString & "')")
        ddlFontName.Attributes.Add("onchange", "ddlFontNameClick(this,'" & frmTxtArea.ClientID.ToString & "')")
        ddlFontColor.Attributes.Add("onchange", "ddlFontColorClick(this,'" & frmTxtArea.ClientID.ToString & "')")

        imgImage.Attributes.Add("onmouseover", "imgMouseOver(this,'insertimage.over.gif');")
        imgImage.Attributes.Add("onmouseout", "imgMouseOut(this,'insertimage.gif');")
        imgImage.Attributes.Add("onclick", "imgImageClick('" & frmTxtArea.ClientID.ToString & "','/www.atcomaart.in/Images/article images',event);")

        imgLink.Attributes.Add("onmouseover", "imgMouseOver(this,'LinkManager.gif');")
        imgLink.Attributes.Add("onmouseout", "imgMouseOut(this,'LinkManager.gif');")
        imgLink.Attributes.Add("onclick", "imgLinkClick('" & frmTxtArea.ClientID.ToString & "',event);")


        imgWordCount.Attributes.Add("onmouseover", "imgMouseOver(this,'wordcount.over.gif');")
        imgWordCount.Attributes.Add("onmouseout", "imgMouseOut(this,'wordcount.gif');")
        imgWordCount.Attributes.Add("onclick", "imgWordCount('" & frmTxtArea.ClientID.ToString & "','" & lblCount.ClientID.ToString & "');")



        imgNormal.Style.Add("background-Color", "#B6BDD2")
        imgNormal.Style.Add("border", "1px solid black")
        imgNormal.Attributes.Add("onmouseout", "imgImgMouseOut(this,'" & frmTxtArea.ClientID.ToString & "')")
        imgHtml.Attributes.Add("onmouseout", "imgImgMouseOut(this,'" & txtAreaDiv.ClientID.ToString & "')")
        imgPreview.Attributes.Add("onmouseout", "imgImgMouseOut(this,'" & divPreview.ClientID.ToString & "')")


        imgHtml.Attributes.Add("onclick", "ConvertHTML('" & frmTxtArea.ClientID.ToString & "','" & txtAreaDiv.ClientID.ToString & "','" & divPreview.ClientID.ToString & "','" & imgPreview.ClientID.ToString & "','" & imgNormal.ClientID.ToString & "','" & tblMenu.ClientID.ToString & "')")
        imgNormal.Attributes.Add("onclick", "ConvertNormal('" & frmTxtArea.ClientID.ToString & "','" & txtAreaDiv.ClientID.ToString & "','" & divPreview.ClientID.ToString & "','" & imgPreview.ClientID.ToString & "','" & imgHtml.ClientID.ToString & "','" & tblMenu.ClientID.ToString & "')")
        imgPreview.Attributes.Add("onclick", "ConvertPreview('" & frmTxtArea.ClientID.ToString & "','" & txtAreaDiv.ClientID.ToString & "','" & divPreview.ClientID.ToString & "','" & imgHtml.ClientID.ToString & "','" & imgNormal.ClientID.ToString & "','" & tblMenu.ClientID.ToString & "')")

        btnClear.Attributes.Add("onclick", "return btnClearClick('" & frmTxtArea.ClientID.ToString & "')")


        'tdfrmTxtArea.Attributes.Add("onmouseout", "imgWordCount('" & frmTxtArea.ClientID.ToString & "','" & lblCount.ClientID.ToString & "');")

        'imgPreview.Attributes.Add("onclick", "ShowPreview();")


        '' ''tdItalic.Attributes.Add("onmouseover", "tdMouseOver(this);")
        ' ''tdUnderLine.Attributes.Add("onmouseover", "tdMouseOver(this);")
        ' ''tdFontSize.Attributes.Add("onmouseover", "tdMouseOver(this);")
        ' ''tdFontName.Attributes.Add("onmouseover", "tdMouseOver(this);")
        ' ''tdFontColor.Attributes.Add("onmouseover", "tdMouseOver(this);")
        ' ''tdImage.Attributes.Add("onmouseover", "tdMouseOver(this);")
        ' ''tdHyperLink.Attributes.Add("onmouseover", "tdMouseOver(this);")

        '' ''imgBold.Attributes.Add("onmouseout", "imgBoldMouseOut(this);")
        '' ''tdItalic.Attributes.Add("onmouseout", "tdItalicMouseOut(this);")
        ' ''tdUnderLine.Attributes.Add("onmouseout", "tdUnderLineMouseOut(this);")
        ' ''tdFontSize.Attributes.Add("onmouseout", "tdMouseOut(this);")
        ' ''tdFontName.Attributes.Add("onmouseout", "tdMouseOut(this);")
        ' ''tdFontColor.Attributes.Add("onmouseout", "tdMouseOut(this);")
        ' ''tdImage.Attributes.Add("onmouseout", "tdMouseOut(this);")
        ' ''tdHyperLink.Attributes.Add("onmouseout", "tdMouseOut(this);")

        '' ''imgBold.Attributes.Add("onclick", "return imgBoldClick('" & content.ClientID.ToString & "');")
        '' ''tdItalic.Attributes.Add("onclick", "tdItalicClick();")
        ' ''tdUnderLine.Attributes.Add("onclick", "tdUnderLineClick();")





    End Sub



End Class
