How can the properties of a constituent control be exposed using C# application project?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

How can the properties of a constituent control be exposed using C# application project?

Rating:

The properties of a constituent control can be exposed by the following ways:

  • Creating a public property for a user control.

  • Using the getter and setter for a property in the property definition. It will effect the change in the
    private property of the constituent control.
For example, a constituent button named MyButton1 is used with a user control. A property can be created in a user control named MyButtonColor. When a user requests the ForeColor property of a constituent control, its value is returned in the get code. The property is then set in the set code, as shown below:

public Color MyButtonColor
{
   get
   {
      return(MyButton1.ForeColor);
   }
   set
   {
      MyButton1.ForeColor = value;
   }
}


Rating:



Other articles

Click here to Article home

Microsoft Certification MCSE: MCSA , MCTS, MCDST, MCAD, MCDBA, MCSE Messaging, MCSE Security
JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.
 
HACKER SAFE certified sites prevent over 99.9% of hacker crime.