PC Review


Reply
Thread Tools Rate Thread

Custom controls - React to property change

 
 
news.xs4all.nl
Guest
Posts: n/a
 
      27th May 2011
Hello,

what's the best way to handle a change to one of the
default Control properties (like AutoSize, BackColor and such)?

Override the property itself (get/set) or override the
protected method responsible for raising the On-xxx-Change event?


Regards,
Marcel


 
Reply With Quote
 
 
 
 
Marcel Overweel
Guest
Posts: n/a
 
      30th May 2011

"Peter Duniho" <(E-Mail Removed)> schreef in bericht
news:3sednYGa-(E-Mail Removed)...
> On 5/27/11 3:34 AM, news.xs4all.nl wrote:
>> Hello,
>>
>> what's the best way to handle a change to one of the
>> default Control properties (like AutoSize, BackColor and such)?
>>
>> Override the property itself (get/set) or override the
>> protected method responsible for raising the On-xxx-Change event?

>
> Either override the OnXXXChanged method or handle (subscribe to) the event
> itself.
>
> There's no reason at all to override the actual property unless you
> actually need to modify how that property behaves.
>
> Pete


ok, thanks Pete, that sounds logical.

Best regards,
Marcel


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding custom controls - To add align property to label. swapna_munukoti@yahoo.co.in Microsoft ASP .NET 2 16th Mar 2007 07:54 AM
How could I change the NavigateUrl property at runtime based on another controls property ? Radu Microsoft ASP .NET 2 25th Jan 2007 10:51 AM
Custom Controls Creation (property) Alex Nitulescu Microsoft ASP .NET 1 22nd Feb 2005 07:15 AM
Anchor Property Ignored On Custom Composite Controls =?Utf-8?B?SmFtZXM=?= Microsoft Dot NET Framework Forms 0 23rd Jun 2004 10:12 AM
Property browser support with my custom controls Simon Harvey Microsoft Dot NET Framework 0 20th Oct 2003 04:14 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:56 AM.