Hi everyone, I hope some one can give me some light on this. I have my CustomPaintEventArgs class that has “Pen” property so that it can be assigned with Pen or Pens object. Now here is the dilemma, I should dispose the pen object as soon as I finish with it but when the CustomPaintEventArgs’ “Pen” property is assigned with a Pens object it throws an exception (Changes cannot be made to Brush because permissions are not valid). How can I determine if the Pen property has Pens object. Actualy when it is used as Pens.Black it returns the Pens Black property which is a pen object.

Is there any solution to this? Thanks in advance.
VBDT