Results 1 to 14 of 14

Thread: all of the sudden...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216

    all of the sudden...

    This wouldnt work in my code:
    VB Code:
    1. Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
    2.        
    3.         If (Asc(e.KeyChar)) = 13 Then
    4.             txtchatwin.Text = txtchatwin.Text & vbCrLf & (username) & ":" & " " & chattext.Text
    5.             chattext.Clear()
    6.         End If
    7.     End Sub

    i would keep on pressing enter with nothing happening, it used to work and it has no build errors when i run it. whats the matter with it?

    Thanks

  2. #2
    Lively Member
    Join Date
    Dec 2002
    Location
    southwest pennsylvania
    Posts
    65
    is (username) supposed to be in quotes?
    if you choose not to decide you still have made a choice!

    RUSH rocks!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    no, thanks but it didnt solve my problem

  4. #4
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    What exactly is "(username)"? Is it a variable?
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    i made username the name that you used to log in, i declared it as a string

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    upload the proj ...

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    what do you mean by that... ?

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    send sample of your proj files?

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    my proj isnt really anything yer, theres just a txtbox and another one thats slightly bigger than the other one for chat text. and i already posted the code to that...
    im not quite sure what you mean pirate..

  10. #10
    Lively Member
    Join Date
    Nov 2002
    Posts
    113
    James...

    Is txtchatwin.Text set to multi-line = true ?

    I see you are using a CRLF.

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    yes it is set to multiline=true

  12. #12
    Fanatic Member
    Join Date
    May 2001
    Posts
    837
    im sure this has been solved by the other post thats a "continuation" but anyways, theres no handles text1.KeyPress or something like that on the end of the function declaration
    The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.

  13. #13
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    Try this james:
    VB Code:
    1. Private Sub txtuserinput_KeyPress(ByVal sender As Object, ByVal e As _
    2.         System.Windows.Forms.KeyPressEventArgs) Handles txtUserInput.KeyPress
    3.  
    4.         If Asc(e.KeyChar()) = 13 Then
    5.             txtChatWindow.Text = txtChatWindow.Text & vbCrLf & Username & ":  " & txtUserInput.Text
    6.             txtUserInput.Clear()
    7.         End If
    8.     End Sub
    Thanks go to Pirate for most of the help on this one.
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    216
    Ok thanks ill test it out when i get on my other comp

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