private void btnServer_Click(object sender, EventArgs e) { myServer = new ServerModel(); myServer.AcceptConnection(); myServer.OnDataReceived += MyServer_OnDataRecived; myServer.OnClientConnected += MyServer_OnClientConnected; btnSendData.Visible = false; btnClient.Visible = false; }