views:

1278

answers:

3

Is there a way to enable smooth scroll for ListBox class in Windows Forms framework? (I'm using C# and .NET framework 2.0).

+1  A: 

No there isn't, not in WinForms anyway.

WPF has a feature that can be enabled to do this, and there is a smooth scrolling animation that can be enabled in vista that can give the appearance of smooth scrolling, though it's really just an animated transition. But the scrolling in a ListBox is, as far as I can tell, is hardcoded to do one item at a time.

Raumornie
+2  A: 

It is a system setting. You could change it by P/Invoking SystemParametersInfo with the SPI_SETLISTBOXSMOOTHSCROLLING argument. Doing so is not recommended.

Hans Passant
What @nobugz means by "doing so is not recommended" is that calling SystemParametersInfo applies to ALL ListBoxes. This is a system-wide user preference that you should never change to comply with *your* (developer's) preferences.
Lucas
A: 

Also you take a look Implementing a smoothly animated ListBox in the codeproject.com Fredrik Bornander wrote same control, but this control writted according to windows mobile, but i think you can easy migrate your windows forms projects.

It might be able to give you new ideas.

fyasar