|
-
Jan 27th, 2009, 03:44 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] other methodes of "RTB.SelStart = Len(RTB.Text)"
this code is working fine, but any other ways of doing this code?
Code:
Private Sub RTB_Change()
RTB.SelStart = Len(RTB.Text)
End Sub
because its cursor will round back once and then go to the end of the sentence. it couse vertical scrool bar to go up and down.
any idea? thanks for any help.
Regards,
-
Jan 27th, 2009, 04:09 PM
#2
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
Don't know if it will be the answer, but an easy test.
RTB.SelStart = Len(RTB.TextRTF)
-
Jan 27th, 2009, 05:46 PM
#3
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
try this
Private Sub RTB_Change()
RTB.Visible = false
RTB.SelStart = Len(RTB.Text)
RTB.Visible = true
End Sub
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Jan 27th, 2009, 07:56 PM
#4
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
 Originally Posted by ksuwanto8ksd
this code is working fine, but any other ways of doing this code?
Code:
Private Sub RTB_Change()
RTB.SelStart = Len(RTB.Text)
End Sub
because its cursor will round back once and then go to the end of the sentence. it couse vertical scrool bar to go up and down.
any idea? thanks for any help.
Regards,
this code won't cause what you said. It must be caused by whatever is triggering this event in the first place. If you are overwriting the entire text of the textbox with new text it will reset the cursor to the beginning.
-
Jan 28th, 2009, 09:20 AM
#5
Thread Starter
Fanatic Member
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
lavolve and isnoend07 your code have no diffrent with mine, thanks.
Lord Orwell how do I prevent cursor from going back to the beginning ?.
thanks for all replay
Regards,
-
Jan 28th, 2009, 11:29 AM
#6
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
Maybe you should so us your code. Especially what happens before setting the cursor to the end of the RTB control.
-
Jan 28th, 2009, 12:38 PM
#7
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
if you are appending text to the end of a rtb, there are two ways to do it:
1.
rtb.text = rtb.text + newtext
and 2
RTB.SelStart = Len(RTB.Text)
rtb.seltext = newtext
rtb.selstart = len(rtb.text)
The problem with 1 is it resets the line position because what you are actually doing is erasing everything in the textbox and rewriting it again. You shouldn't expect the cursor to be in the same place when you are done.
#2 appends text onto the existing text and you shouldn't have any problems with cursor position.
There are more advanced methods of working with a rtb involving editing the .textrtf or the .selrtf properties but depending on your application they may not be necessary.
-
Jan 28th, 2009, 01:02 PM
#8
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
If you want new text on a new line then you can do
rtb.selstart = len(rtb.text)
rtb.seltext = vbnewline & newtext
Waiting for a full featured smart phone with out marrying a provider
Go Android
Go raiders 
-
Feb 6th, 2009, 02:49 AM
#9
Thread Starter
Fanatic Member
Re: other methodes of "RTB.SelStart = Len(RTB.Text)"
thanks for all help, this dont couse serious problem.
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
|