End Sub Error

You have added the event manually and then pasted it’s definition along with it’s code. What you have is effectively:

Sub Open() Handles Open
Sub Open() Handles Open
//This line with the correct name of the class
//on the window must be added in the Window1 Open Event
//**Only call this once in the program**
pi = New pigpio
Call pi. gpiolnitialise ()
pi.Handle = pi.pigpio_start (nil, nil)
End Sub
End Sub

By adding the event using the IDE you create the

Sub Open() Handles Open
End Sub

You then only need to copy and paste the contents. You can copy and paste the whole function and then click on the window and paste the whole thing in one go.