I have a TrackBar control that is part of a custom control. It functions fine, except I need to disable keyboard control of the TrackBar, i.e. the user should be able to drag the value of the trackbar with the mouse but not set it with the Home, End, or arrow keys. The reason for this is that the custom control is intended to be placed into a scrollable list. In other words, there can be 15 - 50 (or even more) of these controls in a single scroll list, and I want the Home, End, and arrow keys to ONLY control focus in the list.

What I have now works, so long as the user doesn't have focus on the TrackBar. When he does, then focus still shifts, but only after the value of the TrackBar on the currently selected control is adjusted.

In order to implement the focus change, I'm trapping the KeyUp event on the custom control and every sub-control on it. When any of those keys are pressed, I set e.Handled and e.SuppressKeyPress to true, but it isn't stopping the TrackBar from processing the keystroke to adjust the value.

Any ideas on how I can disable the TrackBar from processing these keystroke commands to alter the value?

I'm using .NET 4.0 under Windows 7.