我有两种形式,第二种形式将项目添加到主窗体上的列表视图然后卸载,问题是在卸载后,组合框中的值应该预先填充,重置为它的默认值。
With frmmain.ListView1
For i = 1 To .ListItems.count
If Me.txtfname.Value = .ListItems(i).SubItems(2) And Format(Me.txtfsize.Value, "#,###") & " bytes" = .ListItems(i).SubItems(3) Then
If frmmain.cboClient.Value <> UCase("mcy") Then
.ListItems(i).SubItems(1) = ""
Else
.ListItems(i).SubItems(1) = Me.txtBname.Value
End If
If .ListItems(i).SubItems(2) <> Me.txtfname.Value Then
.ListItems(i).SubItems(2) = Me.txtfname.Value
End If
If .ListItems(i).SubItems(3) <> Me.txtfsize.Value Then
.ListItems(i).SubItems(3) = Format(Me.txtfsize.Value, "#,###") & " bytes"
End If
End If
here: Next i
End With
With frmmain
Uncheck .ListView1, False
.CheckBox1.Caption = "Check All " & .ListView1.ListItems.count
.CheckBox1.Value = False
End With
Unload Me