By keeping the same project, you can change the output type:
1. Go to the
properties of your
project (right click on the project in VS).
2. In the context menu, choose
properties.
3. In the window that appears, Select the
Application tab (Should be the first one by default).
4. Change the
Output Type for
Windows Application. Save the changes.
5. In the Main function of the file Program.cs put this code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace MyTest
{
class Program
{
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Main());
}
}
}
And In the Form :
public Main()
{
InitializeComponent();
Load += new EventHandler(Main_Load);
}
private void Main_Load(object sender, EventArgs e)
{
listener.start();
}
I hope this will help!