Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Send input to TextBox programatically

 
 
Old 06-05-2006   #1 (permalink)
Marcus


 
 

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 SpecsSystem Spec
Old 06-05-2006   #2 (permalink)
Nick Kramer [MSFT]


 
 

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 SpecsSystem Spec
 

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46