Foxtable(狐表)用户栏目专家坐堂 → 需要进度条


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

主题:需要进度条

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


加好友 发短信
等级:幼狐 帖子:94 积分:1650 威望:0 精华:0 注册:2016/12/22 18:08:00
需要进度条  发帖心情 Post By:2019/3/13 8:40:00 [显示全部帖子]

在下面的代码里加入进度条!

 

For Each file As String In filesys .GetFiles("\\Win-ukpedgbcajr\财务部狐表业务系统\产品统计\产品开piao信息")
    If file.EndsWith(".xls") OrElse file.EndsWith(".xlsx") Then
        Dim Book As New XLS.Book(file)
        Dim Sheet As XLS.Sheet = Book.Sheets(0)
        Dim jsdw As String = sheet(11,1).Text  '结算单位在Excel中的坐标位置
        Dim nms() As String = {"行号","商品编号","商品名称","单据日期","单据类型","单据编号","出库数量","原币出库金额","开piao数量","原币开piao金额","未开piao数量","原币未开piao金额","超额开piao数量","原币超额开piao金额","手工开piao数量","原币手工开piao金额"}
        ' Tables("成品统计表").StopRedraw()
        For n As Integer = 16 To Sheet.Rows.Count -1 '注意下面的循环变量从17开始,而不是从0开始,因为Excel表的第1-16行是标题和列名
            Dim r As Row = Tables("成品统计表").AddNew()
            For m As Integer = 0 To nms.Length - 1
                r(nms(m)) = Sheet(n,m).Value
            Next
            r("结算单位") = jsdw
        Next
    End If
Next

 这个代码写在按钮(导入数据)里面,单击按钮显示找不到名称为“ProgressBar1”的控件!

[此贴子已经被作者于2019/3/13 10:20:09编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
表叔
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:94 积分:1650 威望:0 精华:0 注册:2016/12/22 18:08:00
  发帖心情 Post By:2019/3/13 10:26:00 [显示全部帖子]

以下是引用有点甜在2019/3/13 8:53:00的发言:

参考一下这里

 

http://www.foxtable.com/webhelp/scr/0793.htm

 

Dim files = filesys .GetFiles("\\Win-ukpedgbcajr\财务部狐表业务系统\产品统计\产品开piao信息")
Dim i As Integer = 0
Dim p As WinForm.ProgressBar
p = e.Form.Controls("ProgressBar1")
p.Maximum = files.count * 100
p.Minimum = 0 '设置最小值
p.Value = 0 '设置当前值
For Each file As String In files
    i += 1
    If file.EndsWith(".xls") OrElse file.EndsWith(".xlsx") Then
        Dim Book As New XLS.Book(file)
        Dim Sheet As XLS.Sheet = Book.Sheets(0)
        Dim jsdw As String = sheet(11,1).Text  '结算单位在Excel中的坐标位置
        Dim nms() As String = {"行号","商品编号","商品名称","单据日期","单据类型","单据编号","出库数量","原币出库金额","开piao数量","原币开piao金额","未开piao数量","原币未开piao金额","超额开piao数量","原币超额开piao金额","手工开piao数量","原币手工开piao金额"}
        ' Tables("成品统计表").StopRedraw()
        For n As Integer = 16 To Sheet.Rows.Count -1 '注意下面的循环变量从17开始,而不是从0开始,因为Excel表的第1-16行是标题和列名
            Dim r As Row = Tables("成品统计表").AddNew()
            For m As Integer = 0 To nms.Length - 1
                r(nms(m)) = Sheet(n,m).Value
            Next
            r("结算单位") = jsdw
            p.value += 100 / (sheet.Rows.count-16)
        Next
    End If
    p.value = i * 100
Next


 这个代码写在按钮(导入数据)里面,单击按钮显示找不到名称为“ProgressBar1”的控件!


 回到顶部