Original User: klaughl
I'm hoping to create a simple form tool that will allow access to our individual .tif aerial tiles (about 1 mi X 1 mi) for us to utilize them (at present, they're not being used at all). What I have is a command which calls a windows form (see Pic1). From my admittedly limited knowledge of ArcObjects and VB.NET, this should work, but it's not. When you click search, the window closes and nothing happens. Needless to say, I'm at a loss. See Pic2 to view the code for the search button (also, generically named Button1 in the actual code). I will also post it below as well.
Thanks!
Kevin Laughlin
Wood County, OH Auditor's Office
GIS Department
CODE:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pString = ComboBox1.Text
Dim mxDocument = CType(m_app.Document, IMxDocument)
Dim focusMap = mxDocument.FocusMap
Dim pMap = mxDocument.FocusMap
Dim rasterLayer = New RasterLayerClass
rasterLayer.Name = pString
rasterLayer.CreateFromFilePath("\\10.8.31.2\11001WoodCo")
focusMap.AddLayer(rasterLayer)
pMap.MoveLayer(rasterLayer, pMap.LayerCount - 1)
mxDocument.ActiveView.Refresh()
mxDocument.UpdateContents()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
End Sub