extend a vb.net class

K

Kevin

Hello,

I do not have experience extending a vb.net class and would like some
assistance. I want to extend the Microsoft.Solutions.Framework.Address
class to include a phone number. How do i do this?

Kevin
 
G

Guest

Assuming Microsoft.Solutions.Framework.Address is not a sealed class, just
create a new class and inherit from it. I’ve never written any VB, but here’s
my guess as to what your class should look like:

Class ExtendedAddress
Inherits Microsoft.Solutions.Framework.Address

Public PhoneNumber As String
End Class

Hope that helps.
 
H

Hans Kesting

Kevin said:
Hello,

I do not have experience extending a vb.net class and would like some
assistance. I want to extend the Microsoft.Solutions.Framework.Address
class to include a phone number. How do i do this?

Kevin

In case you are confused by the terminology:

When you "extend" a class, you create a *new* class, that inherits
(all) functionality of the baseclass, and adds some more
(and/or changes some behaviour: overrides a method).
It's not possible to change that baseclass itself (unless you have
access to the sourcecode :) ).

Hans Kesting
 
K

Kevin Spencer

Extensing and inheriting are 2 terms for the same thing. One extends a class
by inheriting it, and adding or changing the inherited class.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top