G
Guest
Hi,
This code (w/c programmatically scrolls a textbox) works in VB 6.0:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam
As Long)
Private Const EM_LINESCROLL = &HB6
Private Sub Command1_Click()
Dim result As Long
' Textbox should scroll after call below.
result = SendMessage(Text1.hwnd, EM_LINESCROLL, 0, 1)
End Sub
but the same code does not work in VB.NET:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam
As Long)
Private Const EM_LINESCROLL As Integer = &HB6
Dim result As Long
result = SendMessage(Textbox1.Handle.ToInt64, EM_LINESCROLL, 0, 1)
result for VB.NET code is always 0. Same happens if hwnd is defined as
IntPtr and Textbox1.Handle is passed to SendMessage. Help please?
This code (w/c programmatically scrolls a textbox) works in VB 6.0:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam
As Long)
Private Const EM_LINESCROLL = &HB6
Private Sub Command1_Click()
Dim result As Long
' Textbox should scroll after call below.
result = SendMessage(Text1.hwnd, EM_LINESCROLL, 0, 1)
End Sub
but the same code does not work in VB.NET:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam
As Long)
Private Const EM_LINESCROLL As Integer = &HB6
Dim result As Long
result = SendMessage(Textbox1.Handle.ToInt64, EM_LINESCROLL, 0, 1)
result for VB.NET code is always 0. Same happens if hwnd is defined as
IntPtr and Textbox1.Handle is passed to SendMessage. Help please?