|
-
Sep 24th, 2002, 03:20 PM
#1
Thread Starter
Member
Richtextbox setting focues on character
I have a richtextbox.
I print certain logging information in it.
The problem is that the textbox doesn't automaticly scrolldown when I print text in it.
I now there is a way to do that. I've read it somewhere before but I can't seem to find it using Google.
Could someone help me out?
-
Sep 24th, 2002, 03:23 PM
#2
VB Code:
With RTF
.SelStart = Len(.Text)
End With
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Sep 24th, 2002, 03:26 PM
#3
Thread Starter
Member
Thank you very much for the real fast reply
-
Sep 25th, 2002, 08:27 AM
#4
In addition, there are a variety of ways to scroll both a standard text box and a richtextbox using the SendMessage API. Here is an example along with various scrolling messages that can be sent to the box.
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_SCROLL = &HB5
Private Const SB_PAGEDOWN = 3
Private Sub RichTextBox1_Change()
SendMessage RichTextBox1.hwnd, EM_SCROLL, SB_PAGEDOWN, ByVal 0&
End Sub
'Other parameters
Private Const SB_BOTTOM = 7
Private Const SB_LEFT = 6
Private Const SB_LINEDOWN = 1
Private Const SB_LINELEFT = 0
Private Const SB_LINERIGHT = 1
Private Const SB_LINEUP = 0
Private Const SB_PAGEDOWN = 3
Private Const SB_PAGELEFT = 2
Private Const SB_PAGERIGHT = 3
Private Const SB_PAGEUP = 2
Private Const SB_RIGHT = 7
Private Const SB_THUMBPOSITION = 4
Private Const SB_THUMBTRACK = 5
Private Const SB_TOP = 6
Private Const SB_ENDSCROLL = 8
-
Sep 25th, 2002, 10:21 AM
#5
Thread Starter
Member
Originally posted by Hack
In addition, there are a variety of ways to scroll both a standard text box and a richtextbox using the SendMessage API. Here is an example along with various scrolling messages that can be sent to the box.
VB Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const EM_SCROLL = &HB5
Private Const SB_PAGEDOWN = 3
Private Sub RichTextBox1_Change()
SendMessage RichTextBox1.hwnd, EM_SCROLL, SB_PAGEDOWN, ByVal 0&
End Sub
'Other parameters
Private Const SB_BOTTOM = 7
Private Const SB_LEFT = 6
Private Const SB_LINEDOWN = 1
Private Const SB_LINELEFT = 0
Private Const SB_LINERIGHT = 1
Private Const SB_LINEUP = 0
Private Const SB_PAGEDOWN = 3
Private Const SB_PAGELEFT = 2
Private Const SB_PAGERIGHT = 3
Private Const SB_PAGEUP = 2
Private Const SB_RIGHT = 7
Private Const SB_THUMBPOSITION = 4
Private Const SB_THUMBTRACK = 5
Private Const SB_TOP = 6
Private Const SB_ENDSCROLL = 8
Thank you!
That might come in handy in a other situation!
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
|