Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts 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

Simulate keyboard input in WPF

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 06-03-2007   #1 (permalink)
Derek Yang
Guest


 

Simulate keyboard input in WPF

Hi,

I'm trying to simulate keyboard input using RaiseEvent and
TextComposition. My code snippet looks like:

TextComposition textComposition = new
TextComposition(InputManager.Current, txtBox, "text to input");
TextCompositionEventArgs e = new
TextCompositionEventArgs(Keyboard.PrimaryDevice, textComposition);
e.RoutedEvent = UIElement.TextInputEvent;
txtBox.RaiseEvent(e);

My question is: How to simulate an input of the tab key? Is there some
way to express that to pass to the TextComposition instance? I read
through the MSDN doc but there is no explanation as to how to achieve
this.

Thanks a lot,

Derek


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
No sound, no keyboard input Paul H Vista General 2 04-22-2008 05:01 PM
Keyboard Input Language Brink Tutorials 0 11-03-2007 11:58 AM
Using COM Port as Keyboard input JCameron Vista hardware & devices 8 10-28-2007 10:28 PM
keyboard input issue jsingsa Vista security 1 10-23-2007 10:16 AM
Slow keyboard input Alfred Hughey Vista General 1 02-10-2007 01:11 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 51