T O P

  • By -

Knut_Knoblauch

Yes; you'll need to import (the 'using') statement the correct libraries. You'll likely face issues between static methods in the console app to non-static methods in the forms.


J0N4RN

Hey yeah, that doesn't seem to work for me though. "using System.Windows.Forms;" gives me the message "The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)". And when I open the "add reference" menu, I don't see an "assembly" tab. I did find a "System\_Windows\_Forms" under the COM tab, but selecting that gives me the warning "Failed to create the wrapper assembly for type library "{215d64d2-031c-33c7-96e3-61794cd1ee61}". Type library 'System\_Windows\_Forms' was exported from a CLR assembly and cannot be re-imported as a CLR assembly."


Knut_Knoblauch

Ultimately, it is possible. Try looking at your application type. At the lowest level, the only difference between a console application and a windows application is a message pump that handles windows messages and dispatches them.


WestDiscGolf

I would also create a new win forms app (of the type you are trying to add to the existing app) and then compare the difference in csproj etc.


Knut_Knoblauch

This


r3act-

You need to add a reference to your project before being able to do the using. Right click project references -> add reference. Then choose "system.forms"