| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1457 人关注过本帖
标题:VB6.0 控件数组遍历问题
取消只看楼主 加入收藏
Ez330阿牛
Rank: 2
等 级:论坛游民
帖 子:42
专家分:14
注 册:2014-3-5
结帖率:11.11%
收藏
 问题点数:0 回复次数:0 
VB6.0 控件数组遍历问题
For Each fs In MyForm.Controls
        If 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
我这个自动保存的遇到控件数组的话就只保存了一个,其它的都不保存,该怎么解决
2014-05-01 22:20
快速回复:VB6.0 控件数组遍历问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017511 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved