以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]并列条件和代码怎么表达  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=73556)

--  作者:fox20150629
--  发布时间:2015/8/21 13:56:00
--  [求助]并列条件和代码怎么表达
想要实现单元格动态变背景色,根据三个单元格的空值情况来表达,代码如下,老是出现编译错误,是什么问题呢
If e.Row("1时间") = Nothing 
   e.Row("2时间") = Nothing 
   e.Row("3时间") IsNot Nothing 
Then
    e.Style = "绿色"
End If
If e.Row("1时间") IsNot Nothing 
      e.Row("2时间") = Nothing 
      e.Row("3时间") IsNot Nothing   Then
    e.Style = "橙色"
End If
If e.Row("1时间") IsNot Nothing 
    e.Row("2时间") IsNot Nothing 
     e.Row("3时间") IsNot Nothing   Then
    e.Style = "灰色"
End If
If e.Row("1时间") = Nothing 
    e.Row("2时间") = Nothing 
     e.Row("3时间") = Nothing   Then
    e.Style = "白色"
End If


--  作者:大红袍
--  发布时间:2015/8/21 14:06:00
--  

呃。

 

If e.Row.IsNull("1时间") andalso  e.Row.IsNull("2时间") andalso  e.Row.IsNull("3时间") Then
 
 

 


--  作者:大红袍
--  发布时间:2015/8/21 14:06:00
--  
If e.Row.IsNull("1时间") = false andalso e.Row.IsNull("2时间") andalso e.Row.IsNull("3时间") Then
--  作者:fox20150629
--  发布时间:2015/8/21 14:10:00
--  
以下是引用大红袍在2015/8/21 14:06:00的发言:
If e.Row.IsNull("1时间") = false andalso e.Row.IsNull("2时间") andalso e.Row.IsNull("3时间") Then是有=false的对吧,如果是空值则为true?


--  作者:大红袍
--  发布时间:2015/8/21 14:36:00
--  
嗯嗯,是
--  作者:fox20150629
--  发布时间:2015/8/21 14:48:00
--  
谢谢,终于解决了~