Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Location
    West Monroe, LA
    Posts
    294

    Replace selected text in Input

    Having trouble....

    Trying to have a button to add "<b>" in the beginning and "<\b>" at the end of selected text inside an input box. not all the text inside just what is selected. Just like if you were to make BOLD bold by selecting the button in this message box.
    SELECT * FROM Users WHERE IQ > 0;
    o rows Returned

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    its not as simple as you would have thought, i did this for my BBCoder way back, inserting the tags, i rewrote the system 3 times

    search the forum for worms 'caret' dll, you will need it to get precise positions on the cursor, then when adding the text you calculate how much text was added from the start point + 3 (for <b>) and the endpoint (new string length - 4 for </b>) and set the selection to the result (text that was added)

    its tricky to get right

    take a look at my app, i no longer have the source but i would be willing to write the system for you, do you have finance ?

    BBCoder v3
    Open your eyes to Narcissism, Don't let her destroy your life!!

Posting Permissions

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