| |
gold7
Posts: 10
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
|
Ahh.. You definitely have a problem. HTML text objects don't have text selection properties like VB text objects. I can think of two workarounds, both of them ugly. The first involves DHTML. You could capture the onMouseDown event of the text area. If you use a fixed width font (ie, courier) you can calculate the current row and column that the cursor is at, based upon the x and y offsets of the event object relative to the X and Y cooridinates and sizes of the textarea. Once you know the column and row, you can use createTextRange to convert the text of the area into a TextRange object. You can then manipulate the TextRange object to grab the left characters before the cursor position, add the inserted string, then add the right characters after the cursor, then replace the .text of the textrange with your new text. One obvious problems with this approach include large fonts may screw up your location calculations. Option two involves using the VB textbox as an ActiveX component for your editing box, instead of a |
|