private void RefreshDeviceList_Click(object sender, EventArgs e) { lock (singleThreadLock) { deviceList.BeginUpdate(); deviceList.Items.Clear(); var devices = Keyboards.Get().ToArray(); if (devices.Length > 0) { ListViewItem[] items = Array.ConvertAll(devices, i => new ListViewItem(new string[] { i.Handle.ToInt64().ToString(), i.Name, i.Type.ToString(), i.Description })); deviceList.Items.AddRange(items); } deviceList.EndUpdate(); } }