Class Inherits Question

  • Thread starter Thread starter WStoreyII
  • Start date Start date
W

WStoreyII

I want to make a class that inherits datagrid but i want to make it so that
only the properties and the methods that i make are available for use how is
this done?

WStoreyII
 
WStoreyII,
Remember Inherits is about adding or specializing functionality of a base
class.

It is not about REMOVING functionality of a base class.

When you inherit from a class you are saying I have a DataGrid, which also
does these new & cool things.

However it sounds like you want to say: I don't have a DataGrid at all, I
just have this control that happens to display a DataGrid.

I would start with a normal UserControl add a DataGrid to it, then via
delegation (not to be confused with a Delegate type) expose the properties &
methods of the DataGrid on the UserControl.


Remember if you inherit from a class DataGrid, you can place an instance of
your class in a variable of the base class and gain full access to the base
class.

Dim grid As DataGrid = New WStoreyIIDataGrid

The "grid" variable above will have all the properties & methods of a normal
DataGrid!

Hope this helps
Jay
 
Back
Top