以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  Drawcell 代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=48827)

--  作者:tj-pacer
--  发布时间:2014/4/6 19:24:00
--  Drawcell 代码

在Drawcell写入如下代码,想改变单元各的背景颜色,但是报错,应如何写?

Dim nms() As Single = {"A1","B1",“C1","D1"}
For Each nm As Single In nms
If e.Row(nm)< -0.1 Then
 e.Style = "样式1"
Elself e.Row(nm) > 0.1
  e.Style = "样式2"
Next
End If


--  作者:逛逛
--  发布时间:2014/4/6 19:46:00
--  
以下是引用tj-pacer在2014-4-6 19:24:00的发言:

在Drawcell写入如下代码,想改变单元各的背景颜色,但是报错,应如何写?

Dim nms() As Single = {"A1","B1",“C1","D1"}     \'列名数组怎么是单精度类型的,应该是String的吧
For Each nm As Single In nms
If e.Row(nm)< -0.1 Then
 e.Style = "样式1"
Elself e.Row(nm) > 0.1
  e.Style = "样式2"
Next
End If