473,378 Members | 1,407 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Show Dialog Form take two clicks

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
2 2461
* "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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: aj | last post by:
hello, I'm trying to open a form when the user clicks a button that'll show as a pop-up form, but not a dialog form. The problem is that is the user has another form open in Maximize, using the...
10
by: tom | last post by:
Hey All, While running some code, I'd like to open a form as a dialog box (so that the code will wait for the form to be closed/hidden -- easy to do using the acDialog argument), but I would...
1
by: Jim Heavey | last post by:
Hello, there is something that I am forgetting, I just don't remember what is. I create a form which will server as a dialog box. I set the "CancelButton", "AcceptButton" and the...
11
by: AMDRIT | last post by:
Hello Everyone, VB.Net 2003 I would like to open a form (Form2) modally from Form1, then from Form2 display Form3 modally. It seems that once I open that third form and then close it, the...
4
by: randy1200 | last post by:
I have a SideForm. If the use presses a button on the main form, the side form comes up by executing the following: SideForm sf = new SideForm() sf.ShowDialog(); This works perfectly. I've...
1
by: dan.c.roth | last post by:
oForm.Close() vs this.Close() in a modal dialog. oFrom.Close() calls Form.Dispose() but this.Close() ,say in the click event of the Form, does not. I can think of the reason for this but is...
6
by: Norman | last post by:
Hello, I have a working Show / Hide form, that works on FF, but what I would like to do is to be able to display one part when a user clicks on one radio button and display another part when the...
3
by: ApexData | last post by:
I am using code from the following links to establish a Browse File and Browse Folder dialog. http://www.mvps.org/access/api/api0001.htm http://www.mvps.org/access/api/api0002.htm This code...
5
by: Enij | last post by:
Hi All, If I type this code (VB.net 2003): Dim myDialog As frmTestDialog myDialog = New frmTestDialog myDialog.Show()
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.