It was nice talking to you Nalaka.
Based on our discussion, I think I have found at-least one way of solving your problem.
Well there must be some way thru reflection as well, but being a follower of OOPs
Philosophies, I think if you just define an interface with the said function, and base all
your child forms on it, you will get the solution to your problem
Just define an interface which would look something like
Interface IMyBase
Sub Perform_ButtonClick(ByVal Button As String)
End Interface
implement this interface in all your child form classes like this
Public Class Form2
Inherits System.Windows.Forms.Form
Implements IMyBase
.
.
.
Public Sub Perform_ButtonClick(ByVal Button As String) Implements IMyBase.Perform_ButtonClick
MsgBox("FORM II")
End Sub
then change you MdiParent CType.... stetement to this
CType(Me.ActiveMdiChild, IMyBase).Perform_ButtonClick("NEW")
Regards
Ankur Verma
|