What's wrong?
Thomas
Private Declare Function SendMessage Lib "user32" Alias
"SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long,
ByVal lParam As Long) As Long
Const WM_VSCROLL = &H115
Const SB_LINEDOWN = 1
Const SB_LINEUP = 0
Private Sub ScrollUp()
SendMessage(tv1.Handle.ToInt32, WM_VSCROLL, SB_LINEUP, 0)
End Sub
Private Sub ScrollDown()
SendMessage(tv1.Handle.ToInt32, WM_VSCROLL, SB_LINEDOWN, 0)
End Sub
"Thomas Schoch" <tosch_...@swissonline.ch> schrieb:
> I have taken the code below from VB6 and tried to run it in my VB.NET
> app. For some unknown reason my treeview won't scroll at all.
Untested changes:
> Private Declare Function SendMessage Lib "user32" Alias
> "SendMessageA" _
> (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long,
> ByVal lParam As Long) As Long
\\\
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA"
( _
ByVal hWnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32 _
) As Int32
///
> Const WM_VSCROLL = &H115
> Const SB_LINEDOWN = 1
> Const SB_LINEUP = 0
Declare the constants "As Int32".
> SendMessage(tv1.Handle.ToInt32, WM_VSCROLL, SB_LINEUP, 0)
[...]
> SendMessage(tv1.Handle.ToInt32, WM_VSCROLL, SB_LINEDOWN, 0)
Use tv1.Handle directly.
Es gibt übrigens auch eine deutschsprachige NG zu VB .NET:
news:microsoft.public.de.german.entwickler.dotnet.vb
Regards,
Herfried K. Wagner
works like a charm, thanks a lot
Thomas