How can I prevent key presses from changing the value of a scrollbar control?

RapierMother

I have a form with a user control that has a vscrollbar control. I would like to handle the user control's keypress event, but when I press the 'down arrow' key (for example), the keypress event isn't handled, and the vscrollbar's value increases instead. Other navigational keys behave this way as well.

I would like to have the vscrollbar stop 'overriding' my intention to raise the keypress event. I was thinking I could set the user control's keypreview property to true, but then I noticed it doesn't have one.

jmcilhinney

You need to look at using the KeyDown or PreviewKeyDown event instead.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why is Excel changing my date display value, and how can I prevent it from doing that?

From Dev

How can I prevent the “User Agent” header of a WKWebView from changing?

From Dev

How can I prevent sizeToFit from changing the UILabel width?

From Dev

How can I prevent PRs from changing my CI configuration?

From Dev

How can I prevent VirtualBox from changing the permissions on the .vbox File?

From Dev

How can I prevent MySQL numeric values from changing? (phpMyAdmin)

From Dev

How can I prevent a program from changing my mouse pointer?

From Dev

How can I prevent followed hyperlinks from changing color?

From Dev

How can I prevent the input volume from changing?

From Dev

How can I prevent angular from changing history and hash?

From Dev

How can I prevent an application (or user) from changing the screen resolution?

From Dev

How can I catch 2+ key presses at once?

From Dev

How can I emulate key presses on Vim startup?

From Dev

How can I store key presses into variables to refactor this code?

From Dev

How can I map repeated key presses to specific?

From Dev

How can I prevent adding the same value (With another key) into a dictionary?

From Dev

How to prevent javascript from changing input value

From Java

How can I prevent the scrollbar overlaying content in IE10?

From Dev

tmux: How can I display the new value for an option, when changing its value through a key-binding?

From Dev

How can I prevent iOS apps from resetting after changing Camera permissions?

From Dev

How can I prevent selection of UITableView from changing when details change and the tableview reorders?

From Dev

How can I prevent a TextView from changing its size when inserting a String? (Android)

From Dev

How can I print a string when the user presses the enter key whilst playing my guessing game?

From Dev

How can I prevent Windows 7 from automatically changing the firewall settings (turning it back on) when changing network location?

From Dev

How we can stop mouse clicks and key presses from being transfered to loaded document in WebBrowser?

From Dev

Can I prevent an iOS user from changing the date and time?

From Dev

How can I prevent a click on MenuItem from being handled in the parent control?

From Dev

How can I prevent a button from getting resized when adding user control to form?

From Dev

How can I return the Value from a .NET IGrouping via a Key?

Related Related

  1. 1

    Why is Excel changing my date display value, and how can I prevent it from doing that?

  2. 2

    How can I prevent the “User Agent” header of a WKWebView from changing?

  3. 3

    How can I prevent sizeToFit from changing the UILabel width?

  4. 4

    How can I prevent PRs from changing my CI configuration?

  5. 5

    How can I prevent VirtualBox from changing the permissions on the .vbox File?

  6. 6

    How can I prevent MySQL numeric values from changing? (phpMyAdmin)

  7. 7

    How can I prevent a program from changing my mouse pointer?

  8. 8

    How can I prevent followed hyperlinks from changing color?

  9. 9

    How can I prevent the input volume from changing?

  10. 10

    How can I prevent angular from changing history and hash?

  11. 11

    How can I prevent an application (or user) from changing the screen resolution?

  12. 12

    How can I catch 2+ key presses at once?

  13. 13

    How can I emulate key presses on Vim startup?

  14. 14

    How can I store key presses into variables to refactor this code?

  15. 15

    How can I map repeated key presses to specific?

  16. 16

    How can I prevent adding the same value (With another key) into a dictionary?

  17. 17

    How to prevent javascript from changing input value

  18. 18

    How can I prevent the scrollbar overlaying content in IE10?

  19. 19

    tmux: How can I display the new value for an option, when changing its value through a key-binding?

  20. 20

    How can I prevent iOS apps from resetting after changing Camera permissions?

  21. 21

    How can I prevent selection of UITableView from changing when details change and the tableview reorders?

  22. 22

    How can I prevent a TextView from changing its size when inserting a String? (Android)

  23. 23

    How can I print a string when the user presses the enter key whilst playing my guessing game?

  24. 24

    How can I prevent Windows 7 from automatically changing the firewall settings (turning it back on) when changing network location?

  25. 25

    How we can stop mouse clicks and key presses from being transfered to loaded document in WebBrowser?

  26. 26

    Can I prevent an iOS user from changing the date and time?

  27. 27

    How can I prevent a click on MenuItem from being handled in the parent control?

  28. 28

    How can I prevent a button from getting resized when adding user control to form?

  29. 29

    How can I return the Value from a .NET IGrouping via a Key?

HotTag

Archive