wpf textbox ctrl+enter事件

                    <TextBox x:Name="xcontent" Text="sfasdf" Grid.Row="0" AcceptsReturn="True" TextWrapping="Wrap" Margin="1,1,1,1" KeyDown="content_key"/>
private void content_key(object sender , KeyEventArgs e)
        {
            if(e.Key==Key.Enter && (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
            {
                Debug.Write("you enter ctrl+enter");
            }
        }
posted @ 2015-04-07 10:08  lindexi  阅读(327)  评论(0编辑  收藏  举报