Im looking for a way to make the RichTextBox in vb to scroll back down after resizing.
rtb1.selstart = len(rtb1.text) .. if that's what you mean, great, but I get the impression that you meant something else.
Actually that is what i meant....Works :) Thx
Is there a way using WM_(something) to cause it to scroll down?
'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
Can someone explain exactly that is used?
LOL u could just do
Private sub Form_resize()
rtb1.selstart = len(rtb1.text)
End Sub
Quote from: Lenny on September 23, 2003, 03:17 PM
Can someone explain exactly that is used?
Explains exactly how you can use it here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditmessages/em_setscrollpos.asp).
What about in vb.net? i am trying :
rtbMain.SelectionStart = Len(rtbMain.Text)
and it isnt working.
edit: got it to work by setting the focus to the RTB first.
rtbMain.Focus()
rtbMain.SelectionStart() = Len(rtbMain.Text)
by setting the focus creates a huge problem... any other solution for vb.net?