tags:

views:

28

answers:

1

Hi

I want to use my software for windows service , so I need to run my software , it takes about 4-5 seconds to draw visual item like buttons or listbox , I do not need visual , because users do not see my software , is there any way to not initialize visual Items ?

+1  A: 

If you don't need a UI, why are you writing a WinForms app? Why not just have a console app which does the job without creating a UI? If you also need a WinForms version, I suggest you put the common functionality in a class library which both the console app and the WinForms app use.

Jon Skeet
I have to do this with 500000 lines of code again , if I do this with winform , I only need 50 lines of code !
Ata
@Ata: Your comment doesn't make a lot of sense, to be honest... but if you've written 500,000 lines of code in the wrong project type, that sounds like it's a problem you should really address properly rather than trying to just hide a UI you don't want or need.
Jon Skeet
@jon , Think you want to rewrite Windows Media Player again .
Ata
@atanu I doubt that you've written WMP - and if you had, but wanted a headless mode, my answer would be the same. Don't create a UI when you don't want it. I'm sorry that that's clearly not the answer you wanted to hear, but it remains my best advice.
Jon Skeet