views:

27

answers:

1

I'm working with Visual studio 2008.

I have a form inherited from DockContent class (Weifen Luo dock panel suite if you ever heard about that library).

I can add another controls on that form. But when I tried to add an event handler via Property tab, Visual studio generated an exception "type is not marked as serializable".

What should I do to fix that problem ?

A: 

I'm guessing the class you are working with has the [Serializable] attribute. Because events are non-serializable, you will have to mark them this way.

[field:NonSerialized] private EventHandler myEvent;

Jess
Thanks a lot, Jess !
nik