I have some questions regarding the 'Adding smart tags' tutorial on your blog.
First of all in your example you use the controldesigner to refer to the backcolor property of the _control. But when you use custom properties(that are browsable in the properties windows) do you need to set them in the _control class or the controldesigner class?
Secondly I was wondering how to implement smart tags that changed depending on a property:
I have a bool property UserDraw, when true the class overrides the OnPaint event and creates a gradient/alpha channel background, when false the system draws the BackColor value. I have added this bool property to the smart tags and when checked/unchecked i'm trying to change the visible smart tags.
So when UserDraw = true following smart tags are visible :
-Gradient Color 1
-Gradient Color 2
-Userdraw
-Alpha channel
when false it should show only these smart tags:
-UserDraw
-BackColor
I tried this:
- Code: Select all
if (_control.userDraw == true)
{
actions.Add(new DesignerActionPropertyItem(....
}
else
{
actions.Add(new DesignerActionPropertyItem(
...
}
return actions;
it works, but only if the smart tags are closed and reopend by leaving the panel and selecting it and when deleting the object from the form i get some huge errors.
Any ideas?
thx, Anti