VScrollBar key events for scrolling

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using the System.Windows.Forms.VScrollBar on my form.
I'm handling VScrollBar Scroll event.

I want to handle the Up, Down, PageUp PageDown keys for this VScrollBar,
but when I register to the keyDown and KeyPress events, it never gets there.
So I also handled the key events of the form and from there I forwarded the
event to the VScrollBar corresponding event, but still the VScrollBar events
in never invoked.

What should I do so I'll be able to scroll my VScrollBar by using the
Up/Down/PageUp/PageDown ?
 
Sharon said:
I'm using the System.Windows.Forms.VScrollBar on my form.
I'm handling VScrollBar Scroll event.

I want to handle the Up, Down, PageUp PageDown keys for this VScrollBar,
but when I register to the keyDown and KeyPress events, it never gets
there.
So I also handled the key events of the form and from there I forwarded
the
event to the VScrollBar corresponding event, but still the VScrollBar
events
in never invoked.

What should I do so I'll be able to scroll my VScrollBar by using the
Up/Down/PageUp/PageDown ?

I did get that to work for a hot minute in an example I had put together.
But it was a hot minute. I had a Messagebox in the Keydown event for the
scrollbar. And then I hit some keys and the messagebox showed each time. I
have some other controls on the form. It seems that VSB needs to have some
kind of focus for this to work, which I got it to work the first time. It
hasn't worked since. I don't know what the deal is with it now. :(
 
Back
Top