Results 1 to 3 of 3

Thread: "Tags" in textboxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2001
    Location
    Reykjavik, Iceland
    Posts
    8

    "Tags" in textboxes

    Hey.. I´ve been trying to write code that replaces a highlighted word/s in a textbox with the click of a button..
    For example, "blabla" becomes "<k>blabla<k>"

    It is probably a very simple thing to do, I just don´t know how. If anyone could help me it'd be greatly appreciated.

  2. #2
    nullus
    Guest

    Smile

    VB Code:
    1. Private Sub Command1_Click()
    2.     Text1.Text = Replace(Text1.Text, Mid(Text1.Text, Text1.SelStart + 1, Text1.SelLength), "weeeee")
    3. End Sub

    where "weeeee" is the text that replaces the selected text

  3. #3
    Megatron
    Guest
    Try this:
    Code:
    If Text1.SelText <> 0 Then Text1.SelText = "<K>" & Text1.SelText & "<K>"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width