I have a winform application UI in c#. I have to now launch the .exe such that it runs in background but does not launch the UI. I have no idea as to how to do it. What changes should I make?
Asked
Active
Viewed 181 times
0
-
So is it suppose to work like a service? – Ghasem Feb 10 '16 at 04:55
-
yes..but it should execute manually and not when windows is started – AP2887 Feb 10 '16 at 05:02
-
You have to start it somewhere. – Hemal Feb 10 '16 at 05:03
-
Either in startup, with batch file, as a service or something like that – Hemal Feb 10 '16 at 05:03
4 Answers
2
Try this...
WindowState = FormWindowState.Minimized;
In the Main window(Main.cs
) , so the app starts with minimized windows state, this can also be set in the properties windows of the main window, set value Minimized
for the property WindowState
also add
this.ShowInTaskbar = false;
to avoid being shown in task bar

Vishnu Babu
- 1,183
- 1
- 13
- 37
0
Your app won't work if you don't launch you form. If you want to hide the form, just use the method Form.Hide(). Besides, this page might be helpful.

DDoSolitary
- 328
- 2
- 13
0
Form1 Obj = new Form1
You can use
Obj.Hide()
or you can write in Form1 constructor
this.visible = false

andy
- 5,979
- 2
- 27
- 49
0
You can hide the form and still have your app running in background.
You can set
opacity
to 0 andShowInTaskbar
tofalse
and still running your app in background.

Hemal
- 3,682
- 1
- 23
- 54