EventsTab issue with PropertyGrid at runtime

J

Joerg Krause

I program a simple forms editor like the VS.NET one and
got the most of the stuff working. One problem is still
unsolved and I need a bit help.

The components I want to edit request the EventsTab for
the PropertyGrid:

[PropertyTab(typeof(System.Windows.Forms.Design.EventsTab),
PropertyTabScope.Component)]
public class MyControl : UserControl
{
///
}

In the main form I add the type and assign the Site of the
current component:

this.propertyGrid.PropertyTabs.AddTabType(typeof(System.Windows.Forms.Design.EventsTab));
this.propertyGrid.Site = component.Site;

I have also implemented IEventBindingService to handle the
code generation:

serviceContainer.AddService(typeof(IEventBindingService), new
EventBindingService(this));

If I start my form the PropertyGrid shows the EventsTab with
the lightning bolt and the BindingService works as expected.
If I add another control with the same PropertyTab Attribute
on it, the EventsTab disappear and whatever I do it will never
come back. The type of control doesn't matter, the first shows
the tab and the second removes it.
Alongside with the EventsTab appears the standard properties Tab,
to let the user switch back to properties view. This
automagically added Tab does not disappear and become selected
and the standard properties are shown, after the EventsTab button
disappers - very strange behavior.

Does anybody has a clue what happens here? Do I miss any other
interfaces I should implement especially for events handling
in my micro-IDE?

What exactly do the Site property of the PropertyGrid? I've
tried some other ISite implementations, but nothing worked.
Do I need to change the property during runtime?

Thank you for any idea or pointer to articles.

-Joerg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top