Solved

VB.NET - Closing Dialog closes parent form.

Posted on 2007-11-26
1
1,153 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now