How to inherit a class in VB.NET

I am new to VB and I want to inherit from DataGridView , I use something like

 Public Class DataGridViewEx Inherits DataGridView End Class 

But the compiler generates an error like End of statement expected , pointing to Inherits DataGridView . What is wrong and how should I do it?

+4
source share
1 answer

Put it on the following line:

 Public Class DataGridViewEx Inherits DataGridView End Class 

MSDN: Inherits

If used, the Inherits statement must be the first non-empty, non-comment line in the class or interface definition. You should immediately follow the class or interface instructions.

+6
source

All Articles