以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]能否多列重复填充?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=134935)

--  作者:职业技术学校
--  发布时间:2019/5/13 12:45:00
--  [求助]能否多列重复填充?
 狐表在使用Ctrl+D进行重复填充的时候,发现只能选择单列进行重复填充,能否可以选择多列进行重复填充呢?
--  作者:y2287958
--  发布时间:2019/5/13 14:01:00
--  
自己写代码完成
--  作者:有点甜
--  发布时间:2019/5/13 14:27:00
--  

参考代码

 

Dim t As Table = Tables("表A")
For i As Integer = t.LeftCol To t.RightCol
    For j As Integer = t.TopRow+1 To t.BottomRow
        t(j, i) = t(j-1, i)
    Next
Next


--  作者:职业技术学校
--  发布时间:2019/5/13 16:06:00
--  请问什么事件发生的时候执行
 在什么事件发生的时候,执行此代码呢?没有找到填充这样的事件……
--  作者:有点甜
--  发布时间:2019/5/13 16:46:00
--  

你可以在keydown事件写代码,按下ctrl+Q的时候,填充,如

 

If e.keycode = keys.Q AndAlso e.control = True Then
    Dim t As Table = e.Table
    For i As Integer = t.LeftCol To t.RightCol
        For j As Integer = t.TopRow+1 To t.BottomRow
            t(j, i) = t(j-1, i)
        Next
    Next
End If