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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Dim scope within an IF 5
Form Load Event 3
Open a form where mouse clicked 1
Form 1
Events on Form 5
Garbage Collection 8
Read private variables between forms 2
Running a windows form project from commandline 1

Back
Top