|
-
Oct 9th, 2000, 05:59 PM
#1
Thread Starter
Frenzied Member
Hi,
I have a multiline text box and a command button. When I click on the button,
I want some text to automatically be entered into the text box.
But, here's the catcher..
The text needs to be entered where the cursor was positioned just prior to
clicking the command button.
I realize the the cursor is no longer in the text box as soon as you click
the button, but I was wondering if it is possible to store the last position
of the cursor so that when you click the button, the text gets entered starting
at the last cursor position.
Also, clicking the command button and inserting the text must not erase any existing
text in the text box. So for example, if the text box has the following text:
"This is a test..."
and the puts the cursur between the "This" and "is" and then clicks the button, the
text should be placed in between "This" and "is".
Is this possible? Any help and example code would be appreciated..
Dan
-
Oct 9th, 2000, 06:12 PM
#2
What you wish to do is very easy.
Code:
Private Sub Command1_Click()
Text1.text = Text1.text & " your text"
End Sub
-
Oct 9th, 2000, 06:24 PM
#3
Frenzied Member
I have the logic, but not the code:
on the TEXT_LostFocus event, make a label say the character where the pointer was at
then when the button is clicked, have it put in the stuff after what label says
NXSupport - Your one-stop source for computer help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|