Posted on: 9/27/2013 7:28:44 PM | Views : 309

Hello, I am having a few problems with this and I am wondering if this is even possible. I want to have a function that waits to return its result until a button is pressed. Let me make an example:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click If ShowModalPopBox("Please help me") = 1 Then !something(here) End If End Sub Function ShowModalPopBox(ByVal title As String) As Integer !displays a modalpopup, works fine !wait until a button on the modal popup has been pressed Return (1) End Function The problem is with the wait. I have tried: Making a boolean, when the button in the showmodalpopup has been pressed it sets a value and then using a Do While to wait until the boolean has changed, this did not work. Then I have tried using WaitHandle.WaitOne Method with ...

Go to the complete details ...