T
Tristan
Hi,
I'm trying to test if two Pen objects are equal as shown below:
Pen p1 = new Pen(Color.Black);
Pen p2 = new Pen(Color.Black);
if (p1.Equals(p2))
{
Console.WriteLine("These pens equal");
}
The problem is that the if statement doesn't return true, I would have
thought that p1 and p2 are the same. Is the only way round this to
write my own function which compares every single property of Pen?
That would be very laborious and time consuming!
Help much appreciated.
Tristan.
I'm trying to test if two Pen objects are equal as shown below:
Pen p1 = new Pen(Color.Black);
Pen p2 = new Pen(Color.Black);
if (p1.Equals(p2))
{
Console.WriteLine("These pens equal");
}
The problem is that the if statement doesn't return true, I would have
thought that p1 and p2 are the same. Is the only way round this to
write my own function which compares every single property of Pen?
That would be very laborious and time consuming!
Help much appreciated.
Tristan.