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
|
Is it possible to use return in addition to tab to go to the next property? In my application I have many properties that are strings and I would like to use return in addition to tab to accept changes. |
|
|
Hi Michael, Here's an outline plan of attack: 1. Use a BuiltInEditorStyle to assign a custom template to the string editor (as discussed in the thread on updating only when focus is lost). 2. In the custom template, hook the text box's Key* or TextInput events (I used PreviewKeyDown) and detect the Return key. 3. Call UIElement.MoveFocus to move focus to the next control down: // Prototype / proof of concept (Why the looped call to MoveFocus? The WPF Property Grid creates some additional controls to contain the editor controls, and you need to skip over those.) This outline doesn't deal with edge cases (e.g. what happens if the user presses Return on the last entry in the grid), or with going to the next property if you have a mix of editors in there, but hopefully it will get you started. |
|