wat is subclassing and how is it used?
-
Why should i use subclassing? I am not sure what it is for or how it is used. do you know where i can find an article about this subject? Thnx, Grtz, Guus
Hi there. Subclassing is the act of deriving a new class by inheriting from an existing class. You would do this if you wanted to take advantage of functionality in the base class and add functionality of your own. For example, let's say you want a text box for your windows forms application, but one that accepts only numbers and ignores other characters typed from the keyboard. In most ways, you want your text box to behave just like a regular text box; you just want the additional functionality that limits keyboard entry to numbers only. You could create a subclass of the TextBox class by inheriting it, then override keyboard handling methods to insure that only numbers are allowed.