private void asyncConnectB_Click(object sender, EventArgs e) { PLC p = SelectedPLC; if (p == null) { return; } connectStatusL.Text = "Connecting asynchronously..."; p.BeginConnect(new AsyncCallback(asyncConnectHandler), p); }