private void HostEnumerator_HostsDiscovered(object sender, HostEnumeratorEventArgs e) { if (this.InvokeRequired) { this.BeginInvoke(new EventHandler<HostEnumeratorEventArgs>(HostEnumerator_HostsDiscovered), sender, e); return; } // check if this is the first callback. if (m_waitingForHosts) { ItemsLV.Items.Clear(); m_waitingForHosts = false; } // populate list with hostnames. if (e != null && e.Hostnames != null) { foreach (string hostname in e.Hostnames) { AddItem(hostname); } } AdjustColumns(); }