Jan. 13, 2005
You could create a class with common properties and then, on the Date
and Textbox controls, you could create a public property that returns this
class. Something like:
Public Class CommonProps
public property Name() as string
.... return Value
end property
public property Age() as string
.... return Value
end property
End Class
Public Class MyTxt
inherits textbox
private props as new commonprops
public property Common() as CommonProps
.... return props
end property
end class
'Then do the same with DateTimePicker
Then both of the controls will have a instance of the
CommonProps class that will contain the common additions that will be
publicly available. I hope this makes sense and that it helps! Have a great
day!
Joseph MCAD
"Art" wrote:
Hi,
I'm still somewhat new to OO. I am creating a class for a TextBox because I
need some specific things for it to do. That is, I'm inheriting a TextBox
and putting in some properties, etc. that I need for it. Now I find I need
to do something similar with a DateTimePicker. Many of the things I have to
add are the same. It seems to me that there's probably an OO way to handle
this so that I don't have to re-type all of the stuff I need in both new
classes. Unfortunately I have no clue how to do this. Can anyone help or
recommend something on-line to read?
Art