vb.net中usercontrol向外抛出事件

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

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

@H_301_2@ ‘定义

@H_301_2@ Public Shared Event myEvent(ByVal StaffCode As String)

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

@H_301_2@ RaiseEvent myEvent(hf_AssignBy.Value)
End Sub

@H_301_2@End Class

@H_301_2@

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

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

@H_301_2@ Dim aa As String = staffCode

@H_301_2@ End Sub

猜你在找的VB相关文章