>>Is there something I'm missing
yeah, don't do that..
The reflection system used by the designer will be looking for properties
and events seperately via the GetProperties and GetEvents reflection
methods.
Use properties for exposing the encapsulated data of your class and events
for exposing the interactions.
--
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"jonpb" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi. I'm using VS2008.
> I have extended a DataGridView with a context menu. I want to allow users
> of the grid to be able to override the default functionality of the
> context menu items. So, I have members of type EventHandler that are set
> to the default implementations in the constructor. The ContextMenu.Popup
> handler does the layout of the menu assigning the member delegates to the
> menu items in the MenuItems.Add function.
>
> Now, if I expose the EventHandlers as Properties, the program compiles
> without error but the WinForms Designer blows up when you view a form that
> contains this grid. It actually goes into an infinite loop sending
> multiple error boxes saying something about a property not being marked as
> Serializable. The only way out is the End Task on Visual Studio. But, the
> EventHandler type is marked as Serializable.
>
> If I exposes the EventHandler as a public member, everything works fine.
>
> Is there something I'm missing, or is this a bug in VS2008
>
> Thanks