oky_sabeni
oky_sabeni

Reputation: 7822

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,

Upvotes: 1

Views: 4748

Answers (1)

Tim
Tim

Reputation: 15247

You need to have a reference to System.Windows.Forms.dll - WPF apps don't reference that by default

Upvotes: 4

Related Questions