Solved

VB.NET - Closing Dialog closes parent form.

Posted on 2007-11-26
1
1,161 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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