I have tried to invoke some method declared in Vb.NET Module. But
Method name is stored in string .
Examples:
Module 1
Sub Method1()
MessageBox.Show("Hi")
End Sub
End Module1
Imports System.Reflection
Imports System.Web
Imports Microsoft.VisualBasic.CallType
Public Class Form1
Public Delegate Sub MakeDelegate()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim SubName As String = "method"
Dim objDelegate As MakeDelegate
objDelegate = AddressOf method
objDelegate.Invoke()
End Sub
End Class
In the above sample, I want to use SubName" instead of "method".
Is there any way to use string instead of method name directly?
Is there any way to access Module Name using Reflection? I want to
call the methodes declared in Module1 through string from Form1
class.
Can anybody help me to reolve this issue?
I have tried CallByName Vb function. But everthing looks for object
reference or method name.
Thanks,
mohan