Ok, so I have a listview on one form, and when a button is pressed it opens up a new form with the contents of the selected listview item and it's subitems in a series of textboxes. The user can then change the data in the textboxes and either press save to make the changes or cancel to close the window. What command would I use to change the selected listview item and subitems to whatever is in the boxes?
this is the code that populates the boxes:
Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim appeditcontents As String = main.passlist.SelectedItems(0).ToString
Dim appstrlen As Integer = appeditcontents.Length()
Dim apptotal As Integer = appstrlen - 16
Dim usereditcontents As String = main.passlist.SelectedItems(0).SubItems(1).ToString
Dim userstrlen As Integer = usereditcontents.Length()
Dim usertotal As Integer = userstrlen - 19
Dim passeditcontents As String = main.passlist.SelectedItems(0).SubItems(2).ToString
Dim passstrlen As Integer = passeditcontents.Length()
Dim passtotal As Integer = passstrlen - 19
appedit.Enabled = False
appedit.Text = main.passlist.SelectedItems(0).ToString.Substring(15, apptotal)
useredit.Text = main.passlist.SelectedItems(0).SubItems(1).ToString.Substring(18, usertotal)
passedit.Text = main.passlist.SelectedItems(0).SubItems(2).ToString.Substring(18, passtotal)
End Sub
Any pointers on cleaning up this code would probably help too.