开发者

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 开发者_JAVA百科missing? : /


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜