vb.net中usercontrol向外抛出事件

前端之家收集整理的这篇文章主要介绍了vb.net中usercontrol向外抛出事件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


‘usercontrol部分
Public Class UserControls_SearchStaffAssignControl
Inherits System.Web.UI.UserControl

‘定义

Public Shared Event myEvent(ByVal StaffCode As String)

Protected Sub btn_assign_Click(sender As Object,e As EventArgs)
’抛出

RaiseEvent myEvent(hf_AssignBy.Value)
End Sub

End Class


‘使用,使用时,继承定义的方法

SearchStaffAssignControl为usercontrol控件的id
Private Sub aasa(staffCode As String) Handles SearchStaffAssignControl.myEvent

Dim aa As String = staffCode

End Sub

原文链接:https://www.f2er.com/vb/256577.html

猜你在找的VB相关文章