Customer Service | Training | Contact Us
You are here: Home > User Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - ArcObjects 3rd Party IDE (C++, VB, C#, Delphi, etc.) forum

Unloading a form in .Net   Dale Shearer Nov 04, 2009
Re: Unloading a form in .Net   Kirk Kuykendall Nov 04, 2009
Re: Unloading a form in .Net   Al Bowe Nov 18, 2009
Re: Unloading a form in .Net   Dale Shearer Nov 19, 2009
Re: Unloading a form in .Net   Al Bowe Nov 19, 2009
Report Inappropriate Content • Top • Print • Reply    
Subject Unloading a form in .Net 
Author Dale Shearer 
Date Nov 04, 2009 
Message Hi, in my application I have the possiblity of having multiple forms open at the same time. Depending on what the user selects I may need a function in one form to close a totally different form if it is open.

I thought I had it fixed with the following code but it does not close the form. Any ideas???

Dale, 
 
Public FormfrmCode As System.Windows.Forms.Form = New frmCode

  Public Sub unLoadfrmCode()
        Try
            FormfrmCode.Close()
        Catch ex As Exception
            MsgBox("An error has occured within the unloadfrmCode selection")
        End Try
    End Sub
 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Unloading a form in .Net 
Author Kirk Kuykendall 
Date Nov 04, 2009 
Message I would use an IExtension to centrally manage all the forms. The tools would find the Extension via IApplication.FindExtension, then ask it to unload the form(s). 
  Kirk Kuykendall
AmberGIS Programming Services & Sales
web: http://www.ambergis.com
blog: http://ambergis.wordpress.com/
LinkedIn: http://www.linkedin.com/in/kirkkuykendall 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Unloading a form in .Net 
Author Al Bowe 
Date Nov 18, 2009 
Message loop through the open forms by form text or name then close them. 
 
dim frm as new your form
	For b As Integer = OpenForms.Count - 1 To 0 Step -1
            If OpenForms.Item(b).Text = "your form text" Then 'can also use .name
                frm = OpenForms.Item(b)
		exit sub
            End If
        Next

frm.close
 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Unloading a form in .Net 
Author Dale Shearer 
Date Nov 19, 2009 
Message Thanks for the reply, I am working in net 3.5 and it looks to me that application should invoke OpenForms. Though OpenForms is not in the dropdown intellisense.

From ESRI's site, application is the only thing I see OpenForms referenced to. Any ideas?

Dale, 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Unloading a form in .Net 
Author Al Bowe 
Date Nov 19, 2009 
Message Imports System.Windows.Forms.Application