vb Code:
Imports System.Reflection Public Class Form1 Sub Say(ByVal Arg1 As String, ByVal arg2 As String) MsgBox(Arg1 & arg2) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim MethodName As String = "Say" Dim Args() As String = {"Hello, ", "World"} Dim thistype As Type = GetType(Form1) Dim mi As MethodInfo = thistype.GetMethod(MethodName) mi.Invoke(Me, Args) End Sub End Class




Reply With Quote