Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Send input to TextBox programatically

Closed Thread
 
Thread Tools Display Modes
Old 06-05-2006   #1 (permalink)
Marcus
Guest


 

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.

Old 06-05-2006   #2 (permalink)
Nick Kramer [MSFT]
Guest


 

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.
>



Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chinese Traditional Input using Phonetic Input Jess Vista General 0 01-11-2008 11:56 AM
Programatically changing JPG Metatags Dzomlija Vista music pictures video 0 01-11-2008 04:38 AM
Programatically disable OWA access ?? voodooking PowerShell 6 12-07-2007 05:22 PM
Missing manual recipient input fields in send dialog? Blue Max Vista print fax & scan 0 05-17-2007 07:12 PM
Programatically detecting ReadyBoost Hector Vista General 1 02-28-2007 01:44 PM








Vistax64.com 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 2005-2008

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 47 48 49 50