This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi,
Is there an easy way to make the tab key move to the next editor rather than out of the PropertyGrid altogether?
|
|
|
There isn't an *easy* way, but there is a way. See the following thread: http://www.mindscape.co.nz/forums/Thread.aspx?ThreadID=1367 (you will need to scroll down just past half way). In particular see http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=1367&PostID=3953, and Sean's complete sample at http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=1367&PostID=3965. |
|
|
How about intercepting Key.TAB in previewKeyDown and turning it into Key.Down. Is there a way to do that?
|
|
|
I don't think that can be done directly. You can probably intercept Key.Tab in OnPreviewKeyDown (though WPF does give special handling to the Tab key so I could be wrong here), and mark it as handled. You could then try raising an artificial KeyDown event to simulate a down arrow, but I am not sure how well this will work (I have a feeling WPF examines the keyboard state itself). A more reliable approach is probably to call the same code the property grid does when it gets a cursor key. Unfortunately this method is private but the code to replicate it is reasonably simple: static void PerformCursorKeyNavigation(Key key) You would call this method, passing Key.Down as the key argument, from your tab interceptor. Please note I have not tested this approach but this is how the grid internally handles arrow keys so it should work for you as well -- my concern would be more around whether tab can be intercepted successfully. The helper functions for the navigation code are as follows: static UIElement GetAncestor(UIElement from, Type ancestorType) |
|
|
I have the same problem.
All treads like "Sean's complete sample at http://www.mindscape.co.nz/forums/Post.aspx?ThreadID=1367&PostID=3965 " implements basic tab navigation.
Works good, but "Shift-Tab" does not select previous editor. Is there any way or example resolving this problem? |
|