Imports ESRI.ArcGIS.esriSystem Imports ESRI.ArcGIS.Geometry Imports ESRI.ArcGIS.Geodatabase Imports ESRI.ArcGIS.Carto Imports System.IO Imports Microsoft.VisualBasic Imports System Imports System.Windows.Forms Public Class FindAddressForm Inherits System.Windows.Forms.Form Public Sub New() MyBase.New() InitializeComponent() ' Populate the street name ComboBox from text file Dim streetList As String streetList = "\\csjs186\CPCommon\ArcMap Add-ins\StreetNameList2.txt" If File.Exists(streetList) Then Dim r As IO.StreamReader r = New IO.StreamReader(streetList) While (r.Peek() > -1) ComboBox1.Items.Add(r.ReadLine.Trim) End While r.Close() Else MsgBox("Can't find " + streetList) Me.Close() End If End Sub
How can I close a Form without ArcMap crashing?Example: Imports ESRI.ArcGIS.esriSystem Imports ESRI.ArcGIS.Geometry Imports ESRI.ArcGIS.Geodatabase Imports ESRI.ArcGIS.Carto Imports System.IO Imports Microsoft.VisualBasic Imports System Imports System.Windows.Forms Public Class FindAddressForm Inherits System.Windows.Forms.Form Public Sub New() MyBase.New() InitializeComponent() ' Populate the street name ComboBox from text file Dim streetList As String streetList = "\\csjs186\CPCommon\ArcMap Add-ins\StreetNameList2.txt" If File.Exists(streetList) Then Dim r As IO.StreamReader r = New IO.StreamReader(streetList) While (r.Peek() > -1) ComboBox1.Items.Add(r.ReadLine.Trim) End While r.Close() Else MsgBox("Can't find " + streetList) Me.Close() End If End Sub
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.