I have a Combobox which contain IdDataClass object and im tying to find the index of an IdDataClass in my ComboBox with an IdDataClass with the same parameter as the one in the ComboBox. 

```
IdDataClass Instance1 = new IdDataClass(0, "Text");
IdDataClass Instance2 = new IdDataClass(0, "Text");
MyComboBox.Items.Add(Instance1);

int Index = MyComboBox.Items.IndexOf(Instance1);

```

This example will work and will return the index of ContactClientIdDataClass1
But this one

```
IdDataClass Instance1 = new IdDataClass(0, "Text");
IdDataClass Instance2 = new IdDataClass(0, "Text");
MyComboBox.Items.Add(Instance1);

int Index = MyComboBox.Items.IndexOf(Instance2);

```

will not work the value of index is -1. My question is why can't i find the index of instance1 with instance2. They have exactly the same value ? 

Ps. I have try to overload the Equals function of my IdDataClass:

```
public class IdDataClass
{
     int _ID;
    string _MyData;

    public IdDataClass(int ID, string Data)
    {
        _ID = ID;
        _MyData = Data;
    }
    public bool Equals(IdDataClass p)
    {
        if ((object)p == null)
        {
            return false;
        }
        return (_ID == p._ID)&&(_MyData == p._MyData);
    }
}

```