Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extending a native property
Message
From
16/12/2003 12:48:19
 
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00859555
Message ID:
00859562
Views:
17
Steve,

I don't know the full answer, but I've just experimented with this just now. If I type public override, I get Intellisense that shows overrideable methods *and* properties. However, all the properties that show up are base properties, none of my own. There must be some syntax that you can use in the base class when defining the properties that lets you know it's overrideable. But, I don't know what that is. I tried virtual and that didn't work (compile error).

*** Editted ***
ignore the above about the base class. See my other reply instead.
*** Editted ***

Keep looking I guess ...

~~Bonnie

>What is the syntax to use to extend a property in a derived class?
>
>Specifically, I want to execute some additional code in response to the setting of the Visible property on a control, and I want it encapsulated in the control class rather than being handled by a delegate on the form.
>
>I know that I can set up a handler for VisibleChanged, but I'm curious as to whether there is a way of overriding and extending the get/set code of the native property.
>
>Thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform