VB6.0 控件数组遍历问题
For Each fs In MyForm.ControlsIf TypeOf fs Is TextBox Then an.WriteInI MyForm.Name, fs.Name, fs.Text, App.path & "\Userver.ini"
If TypeOf fs Is CheckBox Then an.WriteInI MyForm.Name, fs.Name, fs.Value, App.path & "\Userver.ini"
If TypeOf fs Is OptionButton Then an.WriteInI MyForm.Name, fs.Name, fs.Value, App.path & "\Userver.ini"
If TypeOf fs Is ListBox Then
For xf = 0 To fs.ListCount - 1
If fs.List(xf) <> "" Then
If fs.Style = 1 Then
arr = arr & fs.List(xf) & "<>" & fs.Selected(xf) & "|"
Else
arr = arr & fs.List(xf) & "|"
End If
End If
Next
If arr <> "" Then an.WriteInI MyForm.Name, fs.Name, arr, App.path & "\Userver.ini"
End If
If TypeOf fs Is ComboBox Then
arr = ""
For xf = 0 To fs.ListCount - 1
If fs.List(xf) <> "" Then
If fs.Style = 2 Or fs.Style = 0 Then
arr = arr & fs.List(xf) & "|"
Else
arr = arr & fs.Text
End If
End If
Next
If arr <> "" Then
an.WriteInI MyForm.Name, fs.Name, arr, App.path & "\Userver.ini"
an.WriteInI MyForm.Name, fs.Name & ".ListIndex", fs.ListIndex, App.path & "\Userver.ini"
End If
End If
Next
我这个自动保存的遇到控件数组的话就只保存了一个,其它的都不保存,该怎么解决