Question : Passing Paremeters to AddHandler Method in VB.NET

I have a method for examples
    Private Sub SubreportFinancialAssistanceTypes(ByVal sender As Object, ByVal e As SubreportProcessingEventArgs)
     'some database calculation inside this method
    End Sub

I call this method in VB.NET as
AddHandler rptViewer1.LocalReport.SubreportProcessing, AddressOf SubreportFinancialAssistanceTypes

I need to make the SubreportFinancialAssistanceTypes method generic and I need to pass a dataset to this method. The dataset will be a third parameter..Can I do that and how to do???

Answer : Passing Paremeters to AddHandler Method in VB.NET

Something like this:

Construction example:

RaiseEvent SubreportFinancialAssistanceTypesChanged(Me, New SubreportProcessingEventArgs(ds))

Bob
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Public Class SubreportProcessingEventArgs
   Inherits EventArgs
 
   Public Sub New(ByVal ds As DataSet)
      m_ds = ds
   End Sub
 
   Private m_ds As DataSet
   Public ReadOnly Property DataSet
     Get
       Return m_ds
     End Get
   End Property
 
End Class
Random Solutions  
 
programming4us programming4us