I want to use Task as promis. That is, the called function creates a Task , and the caller applies await to it. That task does nothing and just waits for someone else to register it. Something like a crutch in the following code:
Imports System.Threading Public Class Form1 Private Async Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Me.Text = "Click the button to continue" Await ClikTheButton() Me.Text = "Thanks for clicking" End Sub Private Function ClikTheButton() As Task Dim Sem As New SemaphoreSlim(0, 1) Dim Handler As EventHandler = Sub(sender As Object, e As EventArgs) Sem.Release() RemoveHandler Button1.Click, Handler End Sub AddHandler Button1.Click, Handler Return Sem.WaitAsync() End Function End Class