以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  不能灵活设置事件问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=68092)

--  作者:foxC
--  发布时间:2015/5/9 13:18:00
--  不能灵活设置事件问题

似乎不能针对列进行设置某个事件,如某列单元格输入格式为5位数,然后1个字母加4个数字。不能选中列,添加datecolchangeing事件,只能在表属性里。

 

这样的话,表格的其他列也受到限制了。


--  作者:yinyb36
--  发布时间:2015/5/9 13:22:00
--  
If e.DataCol.Name = "XX列" Then
代码
End If

--  作者:Bin
--  发布时间:2015/5/9 13:27:00
--  
这些都能自行编码实现

1.  datecolchangeing 事件
if e.datacol.name="第一列" then
      if System.Text.RegularExpressions.Regex.isMatch(e.newValue,"[a-zA-Z]{1}[0-9]{4}")=false then
        e.cancel=true
      end if
end if

2.BeforeSelRangeChange 事件

If e.NewRange.ColSel= e.Table.Cols("第二列").Index Then
  e.Cancel=True
End If

--  作者:foxC
--  发布时间:2015/5/9 13:44:00
--  
图片点击可在新窗口打开查看 谢谢 我试试可以。哈哈
--  作者:foxC
--  发布时间:2015/5/9 13:55:00
--  
If e.DataCol.name = "编号" Then
If e.NewValue > "" Then
If e.NewValue Like "[A-Z]####" = False Then
e.Cancel = True
End If
End If
End If