Reputation: 216
I'm new to WPF and I want to use 'Keys' object in WPF. That's how my code looks like in WinForm
public List<Keys> keysList= new List<Keys>();
I want to use this in my WPF app but it can't recognize 'Keys'. Is there any alternative? I searched the web and found nothing.
Thanks!!!!
Upvotes: 5
Views: 2946
Reputation: 1453
Just delete the letter s from Keys to be Key
public List<Key> keysList = new List<Key>();
Upvotes: 2
Reputation: 22814
You need to add a using System.Windows.Input
statement at the top of your form. If that doesn't work, make sure you're referencing WindowsBase.dll
.
Upvotes: 4
Reputation: 166606
I think you are using the Key Enumeration Namespace: System.Windows.Forms, where you should be using Key Enumeration Namespace: System.Windows.Input
Upvotes: 4