G
Guest
Question
Hello,
I'm trying to get a MethodInfo class with this code:
---------------------------------------------
Imports System.Reflection
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myType As Type = GetType(A)
Dim mi As MethodInfo = myType.GetMethod("firstMethod",
BindingFlags.NonPublic Or BindingFlags.Public)
If Not mi Is Nothing Then MsgBox("we have it !")
End Sub
End Class
Public Class A
Friend Sub firstMethod()
MsgBox("message from class A")
End Sub
End Class
---------------------------------------------
But methodinfo is always Nothing !
If I make firstMethod a PUBLIC sub it works without the binding flags, but
what I want is to obtain a methodInfo instantiated for a Friend method, and
its property "isFamily" being TRUE...
Can you help me, please ?
Thanks in advance,
Roger Tranchez
..NET 2005 and DB developer
Hello,
I'm trying to get a MethodInfo class with this code:
---------------------------------------------
Imports System.Reflection
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim myType As Type = GetType(A)
Dim mi As MethodInfo = myType.GetMethod("firstMethod",
BindingFlags.NonPublic Or BindingFlags.Public)
If Not mi Is Nothing Then MsgBox("we have it !")
End Sub
End Class
Public Class A
Friend Sub firstMethod()
MsgBox("message from class A")
End Sub
End Class
---------------------------------------------
But methodinfo is always Nothing !
If I make firstMethod a PUBLIC sub it works without the binding flags, but
what I want is to obtain a methodInfo instantiated for a Friend method, and
its property "isFamily" being TRUE...
Can you help me, please ?
Thanks in advance,
Roger Tranchez
..NET 2005 and DB developer