Click here to Skip to main content
15,889,852 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I'm trying to extend a property for every ToolStripMenuItem but that doesnt seems to be working.


bool IExtenderProvider.CanExtend(object extendee)
{
    return extendee is ToolStripMenuItem;
}


if I change it to Control it works good for Controls but not with ToolSripItem.

I'm using VS 2005, is that a problem ?
Posted

1 solution

Add the following line right above the class implementing the IExtenderProvider.

[ProvidePropertyAttribute("Property", typeof(ControlComponent))]
 
Share this answer
 
v4
Comments
Cool Smith 20-Jun-17 8:47am    
Where and how did you use this solution?
Xmen Real 21-Jun-17 0:47am    
Add that line right above the class implementing the IExtenderProvider.
Cool Smith 21-Jun-17 5:37am    
can you show me an example, as i tried the place, but app wont compile, pointing to the line of the code

C:\ExtenderProvider\MyClass.cs(16,50) : Error CS1031: Type expected
C:\ExtenderProvider\MyClass.cs(16,51) : Error CS1518: Expected class, delegate, enum, interface, or struct
C:\ExtenderProvider\MyClass.cs(16,62) : Error CS1026: ) expected
Xmen Real 23-Jun-17 19:26pm    
Create a new question, post your sample code, it will get answered.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900