By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,529 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,529 IT Pros & Developers. It's quick & easy.

How to Update Property Box

P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tom" <no*****@nowhere.none> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
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

Nov 16 '05 #2

P: n/a
Tom
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
Nicholas Paldino [.NET/C# MVP] wrote:
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.

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.