|
-
Jan 20th, 2003, 11:18 AM
#1
Thread Starter
Addicted Member
all of the sudden...
This wouldnt work in my code:
VB Code:
Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If (Asc(e.KeyChar)) = 13 Then
txtchatwin.Text = txtchatwin.Text & vbCrLf & (username) & ":" & " " & chattext.Text
chattext.Clear()
End If
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
-
Jan 20th, 2003, 11:26 AM
#2
Lively Member
is (username) supposed to be in quotes?
if you choose not to decide you still have made a choice!
RUSH rocks!
-
Jan 20th, 2003, 11:51 AM
#3
Thread Starter
Addicted Member
no, thanks but it didnt solve my problem
-
Jan 20th, 2003, 11:56 AM
#4
Hyperactive Member
What exactly is "(username)"? Is it a variable?
-
Jan 20th, 2003, 12:23 PM
#5
Thread Starter
Addicted Member
i made username the name that you used to log in, i declared it as a string
-
Jan 20th, 2003, 12:52 PM
#6
Sleep mode
-
Jan 20th, 2003, 03:04 PM
#7
Thread Starter
Addicted Member
what do you mean by that... ?
-
Jan 20th, 2003, 03:23 PM
#8
Sleep mode
send sample of your proj files?
-
Jan 20th, 2003, 06:57 PM
#9
Thread Starter
Addicted Member
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..
-
Jan 21st, 2003, 04:05 PM
#10
Lively Member
James...
Is txtchatwin.Text set to multi-line = true ?
I see you are using a CRLF.
-
Jan 21st, 2003, 04:10 PM
#11
Thread Starter
Addicted Member
yes it is set to multiline=true
-
Jan 21st, 2003, 05:09 PM
#12
Fanatic Member
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.
-
Jan 21st, 2003, 05:26 PM
#13
Hyperactive Member
Try this james:
VB Code:
Private Sub txtuserinput_KeyPress(ByVal sender As Object, ByVal e As _
System.Windows.Forms.KeyPressEventArgs) Handles txtUserInput.KeyPress
If Asc(e.KeyChar()) = 13 Then
txtChatWindow.Text = txtChatWindow.Text & vbCrLf & Username & ": " & txtUserInput.Text
txtUserInput.Clear()
End If
End Sub
Thanks go to Pirate for most of the help on this one.
-
Jan 21st, 2003, 09:50 PM
#14
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|