OmegaNine
OmegaNine

Reputation: 371

Implementing System.Window.Forms in WPF

I have been trying to find a way to add a notify Icon to an app I am writing in WPF C#. I have found many links to WPF NotifyIcon and while it does do what I want,5 its adds tens of megs to the memory footprint of a 5-8 meg footprint app. It is a bit overkill.

I have also found many tutorials on how to use System.Window.Form to do this and most of them just say to reference them (I assume this means using the 'using' directive). When I try it gives me and error saying that that "forms" doesn't exist in the namespace "Windows". I thought maybe this was outdated and depreciated but I came across the MSDN Documentation for NotifyIcon and it looks current to 4.5.

Is there another way I should be implementing this? Any help would be appreciated.

Thanks

Upvotes: 2

Views: 56

Answers (1)

SimCard
SimCard

Reputation: 305

Assuming you are using Visual Studio:

In the Solution Explorer expand your project and right click on "References"

Go to "Add Reference..."

enter image description here

In the Reference Manager, go to Assemblies -> Framework.

Scroll to System.Windows.Forms and check the box to include the assembly in your project.

enter image description here

You should now be able to add packages under the Windows.Forms assembly.

Upvotes: 3

Related Questions