What reference should I add for the namespace 'Keys'?

  • Автор темы Автор темы zenfreak
  • Дата начала Дата начала

zenfreak

Client
Регистрация
21.08.2013
Сообщения
249
Реакции
12
Баллы
18
I am trying to use:

Код:
Развернуть Свернуть Копировать
string result = Emulator.SendKey(instance.ActiveTab.Handle,System.Windows.Forms.Keys.Enter, KeyboardEvent.Down);
and I'm getting this error:

uJwp4cv.jpg

The type or namespace name 'Keys' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)

What reference should I add to get this working?

This happens in codecreator but I'm pretty sure it's the same in projectmaker
 
Maybe you have old version of this assembly...
Do you have thsi in C# block?
System_forms_keys.png
 
Try start new project and search for namespace keys... I already got that problem in a project...
 
@VladZen In ProjectMaker I just checked it and I have it just like in your picture but I am using CodeCreator and I don't see the .Forms.Keys here:

6U8AOMw.jpg

@SOS Cartões Not sure what you mean ... where should I search for the namespace keys?
@LaGir If this is what you mean, then I have it because I have manually added it after previously getting an error about the namespace name windows.Forms

KFmbBOw.jpg


PS: I'm using the latest version 5.11.5.0
 
If this is what you mean, then I have it because I have manually added it after previously getting an error about the namespace name windows.Forms
WindowsFormsIntegration.dll contains 'System.Windows.Forms.Integration' namespace, but not contains 'System.Windows.Forms' namespace. So, this dll doesn't contain 'Keys' enum.
So you need to add a reference to System.Windows.Forms.dll.
2017-08-10_14-00-27.png
 
  • Спасибо
Реакции: zenfreak и VladZen
@LaGir Thanks again for taking the time to read my mind and understand what I'm having trouble with. My mistake was that I wasn't searching for the system.windows.forms in the references search bar as the error clearly stated.
 

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)