Foxtable(狐表)用户栏目专家坐堂 → 怎么提高计时器效率


  共有2940人关注过本帖树形打印复制链接

主题:怎么提高计时器效率

帅哥哟,离线,有人找我吗?
飞云
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:472 积分:5597 威望:0 精华:0 注册:2015/4/5 14:08:00
怎么提高计时器效率  发帖心情 Post By:2020/4/28 9:25:00 [只看该作者]

根据表"操作按钮名"列动态创建控件,想在计时器中交替显示颜色,下面的代码效率低,程序有卡死现象,老师请问怎么提高运行效率,谢谢!

For Each k As WinForm.Control In e.Form.Controls
    For Each dr As Row In Tables("table2").Rows
        If dr.IsNull("操作按钮名") = False Then '如果作按钮名不为空
            Dim nms() As String = dr("操作按钮名").Split(",") 
            For Each nm As String In nms '遍历
                For Each c As WinForm.Control In e.Form.Controls
                    If Typeof c Is WinForm.Line Then '判断控件
                        Dim t As WinForm.Line= c '使用特定类型的变量引用控件
                        If t.Name=nm Then
                            If dr.Checked Then
                                If t.LineColor=Color.Red Then
                                    If dr.isnull("基本颜色") Then
                                        t.LineColor=Color.White
                                    Else
                                        t.LineColor=Color.FromARGB(dr("基本颜色"))'线条颜色
                                    End If
                                Else
                                    t.LineColor=Color.Red
                                End If
                            End If
                        End If
                    End If
                Next
            Next
        End If
    Next
Next

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107796 积分:548331 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/28 9:51:00 [只看该作者]

没看懂。做个例子发上来看看

 回到顶部