AnsweredAssumed Answered

Adding a Raster via text box

Question asked by geonetadmin on Aug 16, 2010
Latest reply on Aug 17, 2010 by EinBerliner
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.


Kevin Laughlin
Wood County, OH Auditor's Office
GIS Department


    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

        pMap.MoveLayer(rasterLayer, pMap.LayerCount - 1)

    End Sub
    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    End Sub