How to get only the Overridden methods of a base class using reflection in VB.net?

Public Class Employee Public Property EmployeeId() As Integer Get Return m_EmployeeId End Get Set m_EmployeeId = Value End Set End Property Private m_EmployeeId As Integer Public Sub Display() Console.WriteLine("{0} {1}", EmployeeId, EmployeeName) End Sub Public Overrides Function ToString() As String Return [String].Format("Overriden Method : {0} {1}", EmployeeId, EmployeeName) End FunctionEnd Class

The intention is to obtain only the override method of the child class i.e. ToString(). The below is the way to do that

GetType(Employee).GetMethods(BindingFlags.[Public] Or BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.[Static] Or BindingFlags.DeclaredOnly).Where(Function(m) m.IsVirtual).ToList().ForEach(Function(i) Console.WriteLine(i.Name))

The IsVirtual property of MethodBase class does the trick.This property Gets a value indicating whether the method is virtual.It returns true if this method is virtual; otherwise, false.