wpf c# remove eventhandler from scrollviewer

Posted by rubentjeuh on Stack Overflow See other posts from Stack Overflow or by rubentjeuh
Published on 2010-05-27T10:05:14Z Indexed on 2010/05/27 10:11 UTC
Read the original article Hit count: 241

Filed under:
|
|
|
|

I've got this:

<ScrollViewer x:Name="svBegin" CanContentScroll="True">
        <Grid  x:Name="gGegevensGrid" KeyDown="gGegevensGrid_KeyDown" ScrollViewer.VerticalScrollBarVisibility="Visible"></Grid>

As you can see I've got a KeyDown eventhandler on the grid. But when I press the downkey, the scrollviewer scrolls down. Even when I try this, it doesn't work:

svBegin.KeyDown += new KeyEventHandler(svBegin_KeyDown);
svBegin.KeyDown -= new KeyEventHandler(svBegin_KeyDown);

Anybody who knows how to solve this problem?

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf