Erik Karlsson
Erik Karlsson

Reputation: 598

Porting console app to winforms C#, static types error

I made a nice little console app with some 3rd party libraries and stuff. But now I want to port it to winforms. I just copy everything from the console to a new class in the winforms, removed the main and hoped it would work.

But no.

I just get the error static types cannot be used as parameters in some of my functions. Said functions work perfectly well in my console app. And the parameter used in the functions are all from a 3rd party mouse-control library.

What am I missing? : /

Upvotes: 1

Views: 332

Answers (2)

stuartd
stuartd

Reputation: 73253

You could just change your existing project into a Winforms project - see How do I convert a .NET console application to a Winforms or WPF application

Upvotes: 1

Teoman Soygul
Teoman Soygul

Reputation: 25732

Remove static keyword from all your declarations. I'm sure that you put them there to make sure that your static main function for the console app would be able do directly access them. Now as you don't have a static main function, you don't need the static types anymore.

Upvotes: 3

Related Questions