Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cannot close Form2.showdialog

Status
Not open for further replies.

WordTechinc

Programmer
Sep 4, 2009
38
Form1 need to get result from Form2 and keep run next step in Form1. So I used .showdialog() instead of .show(). The problem is I get result from Form2 but looks like Form2 didn't closed. How to close Form2 after .showdialog()

from FORM1;


If dtJobDetailsMileRadius.Rows.Count > 0 Then
If objFrmMileRadius.Visible = False Then
objFrmMileRadius.Dispose()
objFrmMileRadius = New FrmMileRadius(txtJobNo.Text.Trim)
End If

objFrmMileRadius.ShowInTaskbar = True
objFrmMileRadius.dtMileRadiusLocations = dtJobDetailsMileRadius
objFrmMileRadius.ShowDialog()



objFrmMileRadius.Visible = False
objFrmMileRadius.Enabled = False
objFrmMileRadius.ShowInTaskbar = False
objFrmMileRadius.Dispose()
objFrmMileRadius.Close()
Else
CMDSMsgBox("No MileRadius method exist in job details.")
End If



FORM2;



Private Sub cmdClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClose.Click, cmdFormClose.Click


If BoRadiusFlagMRind = True Then ' Dim ReSetFrmTraditionalAnalysis As New FrmTraditionalAnalysis
BoResetFlagMRind = True
Me.Dispose()

Else
BoResetFlagMRind = False
End If


Me.Close()
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top