Click here to Skip to main content
12,882,493 members (26,243 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# WPF C#4.0
ComponentCommands.MoveFocusUp has a default key gesture (Ctrl+Up) I'd like to use in a custom class derived from TextBox.
I've subclassed TextBox, added following command bindings:
this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, CopyCommandHandler)); // Ctrl+C
this.CommandBindings.Add(new CommandBinding(ComponentCommands.MoveFocusUp, MoveCurrentLineUpCommandHandler)); // Ctrl+Up

to the default constructor, and defined handlers too. But only CopyCommandHandler responds to keyboard interaction. Any suggestions?
Posted 6-Aug-12 4:13am
guitcp330
Updated 27-Sep-12 18:42pm
v9

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
guitcp 7-Aug-12 16:05pm
   
Thanks Kenneth for you reply. The solution you proposed is a tutorial showing the standard pattern for custom commands, whereas my question is about a specific predefined command not working as expected.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170422.1 | Last Updated 28 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100