How to Update Property Box

  • Thread starter Thread starter Tom
  • Start date Start date
T

Tom

I have a component that inherits from a textbox. I have added some
properties. Certain changes to one property cause changes to another
property. How do I get those changes to appear in the properties box?
They will show up if you highlight the property but not before. I've
tried this.Update and this.Refresh. They did nothing. Help!

Tom
 
Tom,

What you have to do is create an event named <PropertyName>Changed of
type EventHandler. After you change the value of the property in code, fire
the event. The property grid will hook up to the appropriate event handlers
and then update grid when other properties change as a result.

In .NET 2.0, there is an IPropertyChange interface which will be
supported, which will have a single event you can fire which will indicate
the property that changed.

Hope this helps.
 
I tried what I understood you to be saying but got nothing. I'm writing
in VB but got no responses in the VB group so I came here. This is what
I tried. The property being changed is named DecimalPlaces.

Public Event DecimalPlacesChanged As EventHandler

Dim e As EventArgs
RaiseEvent DecimalPlacesChanged(Me, e)

Tom
 
Back
Top