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

Check to see if a form is visible in .Net   Dale Shearer Nov 04, 2009
Re: Check to see if a form is visible in .N...   Kirk Kuykendall Nov 04, 2009
Re: Check to see if a form is visible in .N...   Dale Shearer Nov 04, 2009
Re: Check to see if a form is visible in .N...   Al Bowe Nov 18, 2009
Report Inappropriate Content • Top • Print • Reply    
Subject Check to see if a form is visible in .Net 
Author Dale Shearer 
Date Nov 04, 2009 
Message Hi, I have a toolbar that will be loading forms for the user. I am using WinWrap to load/show the forms and that works great.

What I am wanting to do is to prevent the user from clicking on the button several times and loading the same form over and over. I can set the form to showdialog so that only 1 form is loaded/visible, but no other forms will load either.

So how can I check to see if the form is visible so it is not loaded again.

Dale, 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Check to see if a form is visible in .Net 
Author Kirk Kuykendall 
Date Nov 04, 2009 
Message Googling for Singleton Form turns up this:
http://hashfactor.wordpress.com/2009/03/31/c-winforms-create-a-single-instance-form/ 
  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: Check to see if a form is visible in .Net 
Author Dale Shearer 
Date Nov 04, 2009 
Message Hi again Kirk, let me take a look at it and I will get back to you.

Dale, 
   
Report Inappropriate Content • Top • Print • Reply    
Subject Re: Check to see if a form is visible in .Net 
Author Al Bowe 
Date Nov 18, 2009 
Message import namespace windows.forms.application

use code below in button click event.

if the form is up then set it else show a new one.

you can also check Form.Created and Form.Visible 
 
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.show