SmartTags problem
Hello,
I'm changing the text property of a control in my ActionList and also the Name property so when I change the Text property of a Button to OK the name property becomes automatically bOK (or OKButton). The code looks like this:
| |
PublicProperty Text()AsString Get Return Control.Text EndGet Set(ByVal ValueAsString) GetPropertyByName("Text").SetValue(Control, Value) GetPropertyByName("Name").SetValue(Control, "b" + Value.TrimEnd("."c, ":"c, " "c)) EndSet EndProperty
|
the problem now is the changed name can be seen in the properties window as expected when calling SetValue on the PropertyDescriptor but I have also a Name property on my SmartTag panel and that don't get updated, only the Text property.
Regards,
stax
[1456 byte] By [
stax0711] at [2007-12-16]
The smart tag panel UI only refreshes itself when it is first opened or when DesignerActionUIService.Refresh(IComponent) is called.
So after you change the Name property you'll need to get a hold of the DesignerActionUIService and call the Refresh method passing in your component.
- mike
Mike Harsh wrote: |
| The smart tag panel UI only refreshes itself when it is first opened or when DesignerActionUIService.Refresh(IComponent) is called. So after you change the Name property you'll need to get a hold of the DesignerActionUIService and call the Refresh method passing in your component. - mike |
|
You're a life saver! Every article I've found on the topic (including articles in recent issues of MSDN Magazine) claims you need to use DesignerActionService (as opposed to DesignerActionUIService) which doesn't even have a Refresh() method. I was also having a problem figuring out how to close the Smart Tag panel and wouldn't you know it, DesignerActionUIService has a HideUI() method. =)
Anyway, I'm just really happy about finally figuring this out. Thanks!