Show Dialog Form take two clicks

  • Thread starter Thread starter B-Dog
  • Start date Start date
B

B-Dog

I've built a form for use as a dialog and I've assigned two buttons, one as
cancel other as yes. On my main form I call it like below but when it
opens I have to click OK twice in order for it to close and get my value.
The first time you click the form blinks then the second time everything
works.

Dim frm As New SelectWO(Me)

frm.ShowDialog(Me)

If frm.ShowDialog = DialogResult.Yes Then

Debug.WriteLine "Test"

Else

frm.Dispose()

End If
 
* "B-Dog said:
I've built a form for use as a dialog and I've assigned two buttons, one as
cancel other as yes. On my main form I call it like below but when it
opens I have to click OK twice in order for it to close and get my value.
The first time you click the form blinks then the second time everything
works.

Dim frm As New SelectWO(Me)

frm.ShowDialog(Me)

Get rid of the line above.
If frm.ShowDialog = DialogResult.Yes Then

Debug.WriteLine "Test"

Else

frm.Dispose()

The rest is OK.
 
Back
Top