Solved

VB.NET - Closing Dialog closes parent form.

Posted on 2007-11-26
1
1,154 Views
Last Modified: 2010-08-05
I am developing a Windows Mobile 5.0 application using VB.NET in VS2005.

I have an issue with dialogs. I have an inital form (InvocieEntryForm) and from it I show a dialog form to select a product (ProductSelectForm).

When I return from the dialog, the ProductSelectForm is not visible. WHat is visible is the parent of the ProductSelectForm. It does not appear that the ProductSelectForm is really being closed as the 'Closing' and 'Closed' events are not fired.

SHown below id how I call the dialog. Its nothing special.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLookup.Click
        Dim p As New ProductSelectForm()
        If (p.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            tbUPC.Text = p.prod.GetUPC()
        End If
 
    End Sub

Open in new window

0
Comment
Question by:lachmann
1 Comment
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20351345
try to do this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLookup.Click
        Dim p As New ProductSelectForm()
        If (p.ShowDialog() = Windows.Forms.DialogResult.OK) Then
            tbUPC.Text = p.prod.GetUPC()
        End If
        Me.Select()
End Sub
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question