Groups | Blog | Home
all groups > vb.net > march 2004 >

vb.net : Class Inherits Question


bloghoo!
3/18/2004 1:31:10 PM
Jay B. Harlow [MVP - Outlook]
3/18/2004 7:45:49 PM
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

[quoted text, click to view]

WStoreyII
3/18/2004 8:39:10 PM
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

AddThis Social Bookmark Button