Saturday 15 September 2012

wpf - Force the use of the shift key while pressing enter -


I have a window in which I would like to force the user to press the shift key when the Enter key is pressed. I can easily cancel the event when pressing only one key, but what I really want is that when the user presses enter the key, it does not respond as if the user also presses the shift key.

Is there any way to do this? Because apparently the control I should use is not an important press event

The context is very simple I should use the KeyDown event. I have an already defined rich text box (I do not like it, but I can not do otherwise) that I can not actually modify, which is a

tag when the user press enter To use, but when the user presses Shift-Enter the user expresses concern about this but does not want to use Shift-Enter instead to teach their users.

Class I is now :.

  Personal sub F_EditeurRTF_PreviewKeyDown (as the object, in the form of System.Windows.Input.KeyEventArgs) handles Me.PreviewKeyDown then e.Key = Key.Enter andalso Then My.Computer. Keyboard.ShiftKeyDown not only add code to simulate the user pressing Shift key in the Pahl. End if ending sub   

It seems that my question is not clear. In simple words, I want my editor "stupid" to think that even when the shift key is pressed, even when it is not. It is only press this person enter the key key.

After the

I am making some assumptions here, based on some details in your question, but let me know that This is what you are searching for:

  Personal sub-rich textbox 1_keydown (object as sender, and system .x.forms.KeyEventArgs) RichTextBox1 handles keyDown if E .ccode = key. Enter the door to doorke (ed.) End if and sub private subdework (by voltage shift is if Valued as) if ShiftIsown the message box. Special actions for the show ("Shift Pushed") when the other message box pressed Shift + Enter. Do special work for the show ("shift not burst") 'case when enter alone end and end    

No comments:

Post a Comment