Public Function GetControlByName(ByVal Name As String) As Control
Dim info As System.Reflection.FieldInfo = Me.GetType().GetField("_" & Name, _
System.Reflection.BindingFlags.NonPublic Or _
System.Reflection.BindingFlags.Instance Or _
System.Reflection.BindingFlags.Public Or _
System.Reflection.BindingFlags.IgnoreCase)
If info Is Nothing Then Return Nothing
Dim o As Object = info.GetValue(Me)
Return o
End Function
|