1

I have a code that selects row data from a listview table in VB.net. I have declared that data as a variable and I can see it if I ask it to dispay a message box (see code below).

Now I would like to take that data and place it into either an existing or new shapefile using ArcObjects but I am unclear on the process.

Any hints or ideas would be helpful.

Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged

    'met en mémoire l'item selectionné
    Dim i As Integer

    If ListView1.SelectedItems.Count = 0 Then
        Exit Sub
    End If
    'Met en mémoire les sous items de l'item séléctionné
    Dim x As String = ""
    Dim y As String = ""
    Dim z As String = ""

    'séléction de l'index de l'item
    i = Val(ListView1.SelectedIndices.Item(0).ToString)
    ' spécifie de prendre toute la rangée sélctionné
    ListView1.FullRowSelect = True
    ' Set the view to show details.
    ListView1.View = View.Details

    'Fait en sorte d'extraire les sous items 1, 2, et 3 (les 3 rangée "message, GeoLat, GeoLong"
    x = (ListView1.Items(i).SubItems(1).Text)
    y = (ListView1.Items(i).SubItems(2).Text)
    z = (ListView1.Items(i).SubItems(3).Text)

    'Concatenation des trois sous items en une ligne.
    Dim a As String = ""
    a = i & " " & x & " " & y & " " & z

    MsgBox(Err.Number & "  " & Err.Description)
    'Pour verifier si la routine fonctionne...
    MessageBox.Show(a)

End Sub

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.