Programming language is vb.net
views:
141answers:
1
A:
You could extend the ListBox class and then override the part of the class that throws the Scroll event.
EDIT: Do you want the Scroll event not to be thrown or do you actually not want the ListBox itself to scroll?
This might work - I cant test it here tho... Also you'll need to port to vb.net
public class BetterListBox : ListBox {
// WM_VSCROLL message constants
private const int WM_VSCROLL = 0x0115;
protected override void WndProc(ref Message m) {
// Trap the WM_VSCROLL message to generate the Scroll event
if (m.Msg != WM_VSCROLL) {
base.WndProc(ref m);
}
}
anger
2010-04-09 04:54:46
I do want the scroll event to be thrown after the keydown or keypress event
tushar
2010-04-09 05:02:41
can you please provide me the code or explain it on how to extend the listbox class and override the appropriate event ?
tushar
2010-04-09 05:06:00
You said you want to disable the scroll event in your question but then below you say you want the scroll event to be thrown? Can you explan your scenario a bit more clearly?
anger
2010-04-09 05:13:40
Sorry I want to say I do not want the scroll event to be thrown after listbox keydown or keyup event
tushar
2010-04-09 05:19:25
I have tried it but it is giving me errorsTwo Errors1) 'ListBox' is a 'namespace' but is used like a 'type'2) The type or namespace name 'Message' could not be foundand can you please provide the same in vb.net
tushar
2010-04-09 05:40:06
Dont have Visual Studio anymore sorry can't help you
anger
2010-04-09 05:44:52
tushar
2010-04-09 06:42:18
any help please
tushar
2010-04-09 07:13:46