G
Giggsy
Hello,
I am creating an application where I have to list my found bluetooth
devices in a ListView. So after each search I will check if the device
already exists.
I do that with the following code, but it doesn't work. It can't be to
difficult I think, but I still haven't solve it..so I ask for your
help!
Can please someone tell me what I do wrong?
foreach (BluetoothDeviceInfo btdi in bdi)
{
ListViewItem lviDevice = new ListViewItem(btdi.DeviceID.ToString());
lviDevice.SubItems.Add(btdi.DeviceName);
if (!lstBTDevices.Items.Contains(lviDevice))
{
lstBTDevices.Items.Add(lviDevice);
bListChanged = true;
}
}
Best regards,
Giggsy
I am creating an application where I have to list my found bluetooth
devices in a ListView. So after each search I will check if the device
already exists.
I do that with the following code, but it doesn't work. It can't be to
difficult I think, but I still haven't solve it..so I ask for your
help!
Can please someone tell me what I do wrong?
foreach (BluetoothDeviceInfo btdi in bdi)
{
ListViewItem lviDevice = new ListViewItem(btdi.DeviceID.ToString());
lviDevice.SubItems.Add(btdi.DeviceName);
if (!lstBTDevices.Items.Contains(lviDevice))
{
lstBTDevices.Items.Add(lviDevice);
bListChanged = true;
}
}
Best regards,
Giggsy