private void Form1_Load(object sender, EventArgs e) { //Parse the IP address IPAddress ipAdd = IPAddress.Parse("localhost"); //Create a new instance of the Monitor class and pass the IP address to the constructor Monitor myMono = new Monitor(ipAdd); //Bind the event to an event handler myMono.StatusChangedEvent += new StatusChangedHandler(myMono_StatusChanged); //Call the metode that starts monitoring for connections myMono.StartMonitoring(); //Let the user know ChatBox.AppendText("Server is ON"); }