Results 1 to 2 of 2

Thread: Text Editor using the replace function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    88

    Text Editor using the replace function

    Hi guys,

    I currently created with a bit of help a program that replaced the word hello in one text box and replacing it with goodbye in the second text box. I want to carry on from this but am finding it hard to find resources or any help. I want to carry on wrting the replaced text to the second text box but i want the format to be multi lined e.g.

    TextBox1 line 1
    TextBox2 line 1
    TextBox1 line 2
    TextBox2 line 2

    So text box 2 under text box 1 at all times.

    Any ideas of how this is possible as I cant find this on the web.

    Caz

    P.S. Here is the program that was created earlier.

    VB Code:
    1. Private Sub Text2_KeyUp(KeyCode As Integer, Shift As Integer)
    2. Dim Word As String
    3. Dim Prts() As String
    4. Dim NewWord As String
    5.  
    6.     If KeyCode = vbKeySpace Then
    7.         Prts = Split(Text2.Text, " ")
    8.        
    9.         Word = Prts(UBound(Prts) - 1)
    10.         Select Case LCase(Word)
    11.             Case "hello": NewWord = "Hey"
    12.             Case "bye": NewWord = "Cya"
    13.             Case Else: NewWord = Word
    14.         End Select
    15.        
    16.         Text1.Text = Replace(Text2.Text, Word, NewWord)
    17.         Text1.SelStart = Len(Text2.Text)
    18.     End If
    19. End Sub

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Dec 2005
    Posts
    88

    Re: Text Editor using the replace function

    any help would be appreciated thanks

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