[VB.NET]调用主窗体的组件

前端之家收集整理的这篇文章主要介绍了[VB.NET]调用主窗体的组件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
调用主窗体的组件 利用子窗体事件刷新主窗体的Dataset __________________________________________________________________________ 如何调用?showdialog???怎么写? __________________________________________________________________________ 子窗体加一个事件 主窗体 Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click Dim child As New Form2 AddHandler child.RefreshEvent,AddressOf RefreshFunc child.ShowDialog() End Sub Private Sub RefreshFunc(ByVal msg As String) MsgBox(msg) End Sub 子窗体 Public Event RefreshEvent(ByVal msg As String) Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click RaiseEvent RefreshEvent( test ) End Sub ***************************************************************************** 欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070212 http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html __________________________________________________________________________ Form2 哪来的??? RefreshEvent这个属性又是什么属性? __________________________________________________________________________ Form2 就是你的子窗体 RefreshEvent是你自己要定义的一个事件 __________________________________________________________________________ 可是我没这个 RefreshEvent 怎么都不出来 __________________________________________________________________________ 说这个不是我子窗体的事件 __________________________________________________________________________ 我看漏了一个全局 __________________________________________________________________________ 嗯,用参数传递也许更好。 __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/263620.html

猜你在找的VB相关文章