There are several forms. They contain a specific set of the same functions for working with a DataGridView (for example, click events, double clicks, etc.). Depending on the event, the function must be launched with certain parameters. So here. Since the code is iterative, I decided to allocate it into a separate class and when opening a form, just cling to the class with parameters, passing the link to the DataGridView there and there (in the class), for the WithEvents event, prescribe all standard procedures for different types of events. But I just can not figure out how to pass the function. For example, in the form class ( FormClass ) there is a function:
Private Sub StartByCellClick(ByVal Arg1 As Object, ByVal Arg2 As Boolean) If Arg2 Then Arg1 = "Test1" Else Arg1 = "Test2" End Sub And there is a class ( Class1 ). How to transfer StartByCellClick function from FormClass class to Class1 class?
Found a solution: How to: Invoke a Delegate Method (Visual Basic)