Therefore how I refresh properties views in VS programmatically(VS= Visual Studio)

  • Thread starter Laurent Liegeois
  • Start date
L

Laurent Liegeois

Hi,
I try to write a Web Custom Control. But I have a little problem for
refreshing the properties view of my Web Control in Visual Studio ().

When I modify the value of text property of my Control by programing, it
changes in the Design view but no in properties viewAnd when in the
design view, I lost the focus and I click above my control. It is
refreshed and text property contains the good value.

Therefore how I refresh properties views programmatically


In fact I look for a method similar to
ControlDesigner.UpdateDesignTimeHtml() for properties view in VS.


Thank you in advance for your help.




*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Hi Laurent,

Frankly I haven't written web controls but in WindowsForms controls (and I
believe it goes for web too) in order to play nicely with the designer you
should notify for any the changes of the control in order property browser
to be refreshed accordingly and Undo/Redo to work. You can do that in two
ways.

1. When you change a property you should call IComponentChangeService's
OnComponentChanging and OnComponentChanged.

-or-

2. (This is what I sugges) to change the propties not directly, but via
PorpertyDescriptor obtained from components TypeDescriptor. This will take
kare of all notifications for you.
 

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