简体   繁体   中英

Can't use SendKeys in WPF application C# VS2010

I want to send a simple Enter Key with this command:

System.Windows.Forms.SendKeys.Send("{ENTER}");

But, I cam't get System.Windows.Forms...the 'Forms' does not exist in the namespace? The application is developed in VS2010 and it is WPF I believe, MainWindow.xaml.cs.

How do I get around it?

Basically, a button in my application will launch an exe and I want to send an 'ENTER' command after that.

Thanks,

您需要引用System.Windows.Forms.dll - 默认情况下WPF应用程序不引用它

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM