[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

Font Serialization Problem

Hugh Williams

10/30/2002 10:18:00 PM

I have a control that serializes, among other things, its font. Reading it
back in yields:

System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Drawing.Font.Equals(Object obj)
at System.Windows.Forms.Control.set_Font(Font value)

I'm writing the font out through the SerializationInfo object:
info.AddValue("Font", base.Font);

And reading back in as follows:
Font font = (Font)info.GetValue("Font", typeof(Font));
base.Font = font; <== ERROR

How do you do this?