|
-
Nov 7th, 2008, 04:06 PM
#1
Thread Starter
Lively Member
[RESOLVED] Key ascii trouble and text1.text
Hi i'm using a Text1.text with following settings:
- Multiline
- Scrollbars, both
And i got key ascii = 13, which enter the text i gave in text2.text.
When i type in all my text until my Text1.text got scrollbars, everytime a new text appears in the text1.text it goes to the top so i have to scroll down to show my new message, any ideas?
And two,
Key ascii buttons works but sometimes it gets like this
User:
Text
And sometimes (Right way) :
User: Text
-
Nov 7th, 2008, 04:36 PM
#2
Re: Key ascii trouble and text1.text
I don't have that prob.
Does it happen when you type or are you send the ascii = 13 (vbCr) by code?
-
Nov 7th, 2008, 04:36 PM
#3
Hyperactive Member
Re: Key ascii trouble and text1.text
After putting something in the textbox, do Text1.SelStart = Len(Text1.Text). it will move the cursor to the bottom, essentially scrolling it to the bottom.
-
Nov 7th, 2008, 04:38 PM
#4
Hyperactive Member
Re: Key ascii trouble and text1.text
For the other problem I'm going to make a guess here and say you're making a chat program. If so, depending on how you handle the data, you may be receiving a vbCrLf after "User:" or you may be sticking one in there. Just do some checks on your code and see where it pops in.
-
Nov 7th, 2008, 04:39 PM
#5
Re: Key ascii trouble and text1.text
If you're sending text from one box to the other and you want the new text added to the bottom then you need to set the SelStart property of the receiving textbox.
-
Nov 7th, 2008, 04:48 PM
#6
Thread Starter
Lively Member
Re: Key ascii trouble and text1.text
danecook21, SelStart worked exellent, yes i think i have a vbcrlf after the coding, but strange that it works the first 1-2 times then it pops under the text, and your guess was right.. Yes I'm making a chat program.
-
Nov 7th, 2008, 04:52 PM
#7
Hyperactive Member
Re: Key ascii trouble and text1.text
Glad to help. Yes it is strange. If you want we would be happy to take a look at the code if you want to post it or attach the project. Otherwise, just do some tests in your code and I'm sure you'll find why it's happening.
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
|