Results 1 to 3 of 3

Thread: text box help...

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091
    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

  2. #2
    Guest
    What you wish to do is very easy.

    Code:
    Private Sub Command1_Click()
    Text1.text = Text1.text & " your text"
    End Sub

  3. #3
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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
  •  



Click Here to Expand Forum to Full Width