By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

Show Dialog Form take two clicks

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* "B-Dog" <bd***@hotmail.com> scripsit:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

P: n/a
that was it, thanks I was opening twice..

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uJ*************@TK2MSFTNGP12.phx.gbl...
* "B-Dog" <bd***@hotmail.com> scripsit:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.