36

I can't seem to find it, trying to keyboard input in a wpf form spawned from a winforms form. Found this: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/442782b1-00a1-4e2e-9cc6-ae99b6699126/ But when I try to use it, VS2008 complains about not being able to find the System.Windows.Forms.Integration namespace. I couldn't find a reference in the add references.

The only thing I can think of it maybe because it was a VS2005 project ported to VS2008?

Davy8
  • 30,868
  • 25
  • 115
  • 173

4 Answers4

70

You'll need to add a reference to WindowsFormsIntegration. If you do a Add Reference in Visual Studio, it will be near the last DLL available in the .Net tab

On my machine it's located at

%ProgramFiles%\Reference Assemblies\Microsoft\Framework\v3.0\WindowsFormsIntegration.dll

Demodave
  • 6,242
  • 6
  • 43
  • 58
JaredPar
  • 733,204
  • 149
  • 1,241
  • 1,454
  • 9
    Oooh, I was looking for System.Windows.Forms.Integration in the list, not WindowsFormsIntegration as one word. Seems odd that they chose to name it that way. – Davy8 Mar 13 '09 at 22:56
  • 1
    @Davy8, I find it quite odd as well. – JaredPar Mar 14 '09 at 00:35
  • To expatiate, this dll is not found where you normally pluck dlls from in Visual studio. Rather, you have to go to a folder with a potpourri of dlls to get it. When you do an "Add Reference" in Visual studio, go to the file path JaredPar provided above and then add it to your project. – Phil Jul 16 '11 at 10:43
  • This hasn't helped me at all... I just keep getting System.Windows.Forms.Integration which has nothing like what I'm looking for in it – Ortund Feb 11 '13 at 13:34
2

Visual Studio filters the available namespaces according to the type of project you chose. If you need a namespace that is not listed, click the [Add...] button on the references tab of your project's properties. This will pop-up the Reference Manager window. Choose "Framework" from the list of Assemblies in the left-hand panel. This will display all the Microsoft provided namespaces. You will find WindowsFormsIntegration there.

1

Just came across the same problem.

While adding a reference to WindowsFormsIntegration.dll didn't work as this has no WF controls in it, I did find that adding a reference to System.Windows.Forms worked perfectly fine.

Ortund
  • 8,095
  • 18
  • 71
  • 139
1

Use newer:

%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\WindowsFormsIntegration.dll
T.Todua
  • 53,146
  • 19
  • 236
  • 237