好的,所以我在一个表单上有一个列表视图,当按下一个按钮时,它会打开一个新表单,其中包含所选列表视图项的内容以及它在一系列文本框中的子项。然后,用户可以更改文本框中的数据,然后按“保存”进行更改,或者取消以关闭窗口。 我将使用什么命令将所选列表视图项和子项更改为框中的任何内容?
这是填充框的代码:
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
任何关于清理此代码的指示都可能有所帮助。