How do I extend the checkbox class and add another string property in C# while maintaining the other pieces of the checkbox class?

Posted on 2007-10-19
Last Modified: 2008-01-09
How do I extend the checkbox class and add another string property in C# while maintaining the other pieces of the checkbox class?

   public class FilterCheckbox {
      private string attributeID = string.Empty;
      public string AttributeID {
         get { return attributeID; }
         set { attributeID = value; }

I want to have this extra value attributeID added to the checkbox class but when I replace a checkbox with this new class, the new class doesn't have all the other codesense properties or methods that the checkbox has, it only has the AttributeID. How do I get the others?
Question by:jbrahy
    1 Comment
    LVL 9

    Accepted Solution

    you can create a class and extend the checkbox class like this:
    public class FilterCheckbox : CheckBox
    private string attributeID;

    this way you'll have all the properties of the checkbox  + your own custom properties.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now