'打开子窗体
Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New frmChild
frm.Show()
End Sub
'触发主窗体事件
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
RaiseEvent MainEvent("这里是你要显示的字符串信息!")
End Sub
End Class
子窗体代码:
Public Class frmChild
Private Sub frmChild_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddHandler frmMain.MainEvent, AddressOf Me.ChildMethod
End Sub
Private Sub ChildMethod(ByVal str As String)
MsgBox(str, MsgBoxStyle.Information, "子窗体显示字符串")
End Sub