Html Editor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mague
    New Member
    • May 2007
    • 137

    Html Editor

    hey i want to beable to make a html editor. I want to make it so you can highlight something an click for eg bold. And then on either sde it will have the <B> blahblahgl <b/>

    Is there a way i cana do this
  • danp129
    Recognized Expert Contributor
    • Jul 2006
    • 323

    #2
    in vb6 it would be:

    [CODE=vb]Private Sub Command1_Click( )
    AddTag "<B>", "</B>"
    End Sub

    Sub AddTag(sStartTa g As String, sEndTag As String)
    Dim lngNextSelStart As Long
    With Text1
    If Not .SelLength > 0 Then
    lngNextSelStart = .SelStart + Len(sStartTag)
    End If
    .SelText = sStartTag & .SelText & sEndTag
    If lngNextSelStart > 0 Then .SelStart = lngNextSelStart
    .SetFocus
    End With
    End Sub[/CODE]

    Comment

    • Mague
      New Member
      • May 2007
      • 137

      #3
      i should have mensioned earlier i use vb.net. Also im am using a richtextbox. Any more idea


      ty anyways
      Mague

      Comment

      • Mague
        New Member
        • May 2007
        • 137

        #4
        Dont worry i fixed it.


        If your intrested i got rid of the with

        changed the selselect to richtextbox.tex tlength

        changed selstart and seltext to richtextbox.sel ectedtext

        and deleted the last command and it worked

        Comment

        Working...