![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Send input to TextBox programatically I everybody, I'm trying, when a control receives an OnPreviewKeyDown event, to send this KeyStroke to another control (control in question varies from a case to another)... By just sending a PreviewKeyDown/KeyDown RoutedEvent to the control, it works fine (for some controls), however, in the case of a TextBox, it fails miserably... I tried passing by the InputManager... (InputManager.Current.ProcessInput()... ) Has anybody succeeded in doing something like this? Or otherwise, is there any other Text input control which would suit my needs? Thanks. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Send input to TextBox programatically There's no way to simulate input in Avalon other than calling Win32's SendInput method. Raising a KeyDown event is an approximation networks in some cases, but as you've noticed, it doesn't work with TextBox because it doesn't generate TextInput events or update the state of the Keyboard class correctly. Perhaps there's another way of accomplishing what you're trying to do -- why do you want to forward keyboard input to another control? -Nick Kramer [MSFT] http://blogs.msdn.com/nickkramer This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Marcus" <larochem@gmail.com> wrote in message news:1149539035.440188.263640@h76g2000cwa.googlegroups.com... >I everybody, > > I'm trying, when a control receives an OnPreviewKeyDown event, to > send this KeyStroke to another control (control in question varies from > a case to another)... By just sending a PreviewKeyDown/KeyDown > RoutedEvent to the control, it works fine (for some controls), however, > in the case of a TextBox, it fails miserably... > > I tried passing by the InputManager... > (InputManager.Current.ProcessInput()... ) > > Has anybody succeeded in doing something like this? > > Or otherwise, is there any other Text input control which would suit > my needs? > > Thanks. > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| auto input of send-to name | Vista mail | |||
| Chinese Traditional Input using Phonetic Input | Vista General | |||
| Programatically changing JPG Metatags | Vista music pictures video | |||
| Missing manual recipient input fields in send dialog? | Vista print fax & scan | |||
| Programatically detecting ReadyBoost | Vista General | |||