Results 1 to 5 of 5

Thread: Someone Please Help Me With This Code

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    Ok I Was Trying To Build An Elite Talker Im Hopes That After That I Could Then Work Out How To Make An Encryption Program. I Don't Know If Anyone Knows What An Elite Talker Does Or Not But Anyway, This Program Consists Of A Form With 3 text boxes, you type in the first and the next message in elite text comes out in the third text box I will give you a code snippet, and then ask you my questions afterwards

    Private Sub Text1_Change()
    If Text1.Text = "a" Then
    Text2.Text = "å"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "b" Then
    Text2.Text = "þ"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "c" Then
    Text2.Text = "¢"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "d" Then
    Text2.Text = "ð"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "e" Then
    Text2.Text = "è"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "f" Then
    Text2.Text = "f"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "g" Then
    Text2.Text = "g"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "h" Then
    Text2.Text = "|-|"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "i" Then
    Text2.Text = "î"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "j" Then
    Text2.Text = "j"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "k" Then
    Text2.Text = "|<"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "l" Then
    Text2.Text = "|"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "m" Then
    Text2.Text = "|V|"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "n" Then
    Text2.Text = "ñ"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "o" Then
    Text2.Text = "Ø"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "p" Then
    Text2.Text = "Þ"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "q" Then
    Text2.Text = "q"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "r" Then
    Text2.Text = "®"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "s" Then
    Text2.Text = "$"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "t" Then
    Text2.Text = "t"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "u" Then
    Text2.Text = "û"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "v" Then
    Text2.Text = "\/"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "w" Then
    Text2.Text = "vv"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "x" Then
    Text2.Text = "×"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "y" Then
    Text2.Text = "ý"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "z" Then
    Text2.Text = "z"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = " " Then
    Text2.Text = " "
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "!" Then
    Text2.Text = "¡"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "1" Then
    Text2.Text = "1"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "2" Then
    Text2.Text = "2"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "3" Then
    Text2.Text = "3"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "4" Then
    Text2.Text = "4"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "5" Then
    Text2.Text = "5"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "6" Then
    Text2.Text = "6"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "7" Then
    Text2.Text = "7"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "8" Then
    Text2.Text = "8"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "9" Then
    Text2.Text = "9"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "0" Then
    Text2.Text = "0"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "A" Then
    Text2.Text = "Å"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "B" Then
    Text2.Text = "ß"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    If Text1.Text = "C" Then
    Text2.Text = "Ç"
    Text1.Text = ""
    Text3.Text = Text3.Text + Text2.Text
    Text1.SetFocus
    End If
    End Sub


    Ok Now With The Code If you press the back space button it doesn't delete in the third text box now how do i do that?

    Also With A Text Box How Can You Make It So You Can Press Enter In It And Get To The NExt Line???

    AND Then how would i get it so i could press enter in the first text box and get it to press enter in the third?

    and how do you attach scroll bars to a text box???

    thanx

  2. #2
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Post

    1:st question
    trace keydown event of text1 for vbkeyBack and trim of the last char of text3.text
    2:nd question
    set property multiline=true
    3:rd question
    Private Sub Text1_Change()
    Text3.Text = Text1.Text
    End Sub
    4:th question
    property scrollbars = None,Vertical,Horizontal,Both
    ------------------
    On Error Goto Bed :0)
    [email protected]


    [This message has been edited by onerrorgoto (edited 12-06-1999).]

    [This message has been edited by onerrorgoto (edited 12-06-1999).]

    [This message has been edited by onerrorgoto (edited 12-06-1999).]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    Can you please give me an example of the first question?

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    Here's an example:

    Private Sub Text1_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyBack And Len(Text3) > 0 Then
    Text3 = Left(Text3, Len(Text3) - 1)
    End If
    End Sub

    Good luck!

    ------------------
    Joacim Andersson
    [email protected]
    [email protected]
    www.YellowBlazer.com



  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    65

    Post

    thanx Joacim that works

    so if i wanted to do the same with cursor keys would i put vbleft instead? but what would i replace the -1 with?

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