'has no member' when adding event handler to dynamically created control -

I hope this is a simple failure on my part to understand, but the docs seem to indicate this is how it’s done.

The following code snip generates an error: Type ‘DesktopUpDownArrows’ has no member ‘DownPressed’… why?

Var newCtrlUpDnArrows As DesktopUpDownArrows = New DesktopUpDownArrows()

AddHandler newCtrlUpDnArrows.DownPressed AddressOf HandleDownArrowPressed

Function HandleDownArrowPressed(sender As DesktopUpDownArrows)

For one thing you’re missing the comma before Addressof.

1 Like

Yikes, sorry I’m embarrassed. That did solve it. A bit of a confusing error message though.

Hopefully this may help someone else equally comma shy.

Thank you for the ultra rapid response!!