Valhalla Legends Forums Archive | Visual Basic Programming | RTB scroll

AuthorMessageTime
Lenny
Im looking for a way to make the RichTextBox in vb to scroll back down after resizing.
September 21, 2003, 4:26 AM
iago
rtb1.selstart = len(rtb1.text) .. if that's what you mean, great, but I get the impression that you meant something else.
September 21, 2003, 11:26 AM
Lenny
Actually that is what i meant....Works :) Thx

Is there a way using WM_(something) to cause it to scroll down?
September 21, 2003, 3:02 PM
SiMi
'sets scroll position
Public 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 WM_USER = &H400
Private Const EM_GETSCROLLPOS = (WM_USER + 221)
Private Const EM_SETSCROLLPOS = (WM_USER + 222)
'gets scroll position
Public Type POINTL
x As Long
y As Long
End Type
September 21, 2003, 4:19 PM
Lenny
Can someone explain exactly that is used?
September 23, 2003, 8:17 PM
NetNX
LOL u could just do

Private sub Form_resize()
rtb1.selstart = len(rtb1.text)
End Sub
December 4, 2003, 3:07 AM
UserLoser.
[quote author=Lenny link=board=31;threadid=2779;start=0#msg22029 date=1064348248]
Can someone explain exactly that is used?
[/quote]


Explains exactly how you can use it here.
December 5, 2003, 1:51 AM
mentalCo.
What about in vb.net? i am trying :
[code]
rtbMain.SelectionStart = Len(rtbMain.Text)
[/code]

and it isnt working.


edit: got it to work by setting the focus to the RTB first.
[code]
rtbMain.Focus()
rtbMain.SelectionStart() = Len(rtbMain.Text)
[/code]
October 27, 2004, 3:18 PM
mentalCo.
by setting the focus creates a huge problem... any other solution for vb.net?
October 27, 2004, 3:29 PM

Search