* "simonc" <an*******@discussions.microsoft.com> scripsit:
Thanks for this information. Unfortunately I have never
used any of these commands and am not really sure how to.
Please could you give an example.
Untested:
Use a RichTextBox control instead of the simple textbox. Untested (have a
look at the MSDN libarary for usage of 'EM_GETSCROLLPOS' and
'EM_SETSCROLLPOS'):
\\\
Private Declare Auto Function SendMessage Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByRef lParam As POINTAPI _
) As Int32
Private Const WM_USER As Int32 = &H400
Private Const EM_GETSCROLLPOS As Int32 = (WM_USER + 221)
Private Const EM_SETSCROLLPOS As Int32 = (WM_USER + 222)
Private Structure POINTAPI
Public x As Int32
Public y As Int32
End Structure
///
Usage:
\\\
Dim pt As POINTAPI
pt.x = ...
pt.y = ...
SendMessage(Me.RichTextBox1.Handle, EM_SETSCROLLPOS, 0, pt)
///
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
<http://www.plig.net/nnq/nquote.html>