c# - listBox onScroll event

J

John Keers

Can anyone tell me how to fire and use a listBox onScroll event. The
language I am using is C# in a windows forms application

thanks
 
M

[MSFT]

Hi John,


ListBox doesnot provide a interface for your to manipulate the scrollbar
directly. As a workaround, you can try sending WM_VSCROLL message via
PInvoke. For
example:


Class Win32
{
[DllImport("User32.Dll")]
public static extern bool SendMessage(IntPtr hWnd,int Msg,int
wParam,int lParam);
public const int WM_VSCROLL = 0x0115;
public const int SB_LINEDOWN = 1;



}


Win32.SendMessage(listBox1.Handle,Win32.WM_VSCROLL,Win32.SB_LINEDOWN,0);

Hope this helps.


Regards,

Luke
 
Joined
Jun 18, 2011
Messages
1
Reaction score
0
Herfried K. Wagner [MVP];6999999 said:
"John Keers" <[email protected]> schrieb:
> Can anyone tell me how to fire and use a listBox onScroll event. The
> language I am using is C# in a windows forms application


<URL:http://groups.google.de/groups?q=WM_VSCROLL+csharp+listbox>

Googling "listbox onscroll", this thread is the third hit in the list. Your post linking to google is about as helpful as tits on a bull. Let's assume everyone was a giant douchenozzle like yourself, and in reply to every question simply posted a link to google... we'd have a results list of google search links. Congratulations on contributing to useless recursion. :cheers:

[MSFT];7004033 said:
Hi John,


ListBox doesnot provide a interface for your to manipulate the scrollbar
directly. As a workaround, you can try sending WM_VSCROLL message via
PInvoke. For
example:


Class Win32
{
[DllImport("User32.Dll")]
public static extern bool SendMessage(IntPtr hWnd,int Msg,int
wParam,int lParam);
public const int WM_VSCROLL = 0x0115;
public const int SB_LINEDOWN = 1;



}


Win32.SendMessage(listBox1.Handle,Win32.WM_VSCROLL,Win32.SB_LINEDOWN,0);

Hope this helps.


Regards,

Luke

Thanks, Luke. This is the sort of information which someone who DOES search for a particular topic expects to find.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top