You could do this:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
button1_clicked = True
End Sub
Private button1_clicked As Boolean = False
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
myfunc()
End Sub
Private Sub myfunc()
MsgBox("Start of function, waiting for button click")
Do While button1_clicked = False
Threading.Thread.Sleep(50)
Application.DoEvents()
Loop
MsgBox("End of function, button is clicked")
End Sub
But .NET has a nice event system, best is to run the next code under the button click event instead.