Vb6 如何找到单元格背景色

Vb6 如何找到单元格背景色,vb6,msflexgrid,Vb6,Msflexgrid,使用Flexgrid 我想检查特定单元格的背景色 代码 上述代码将错误显示为“无效限定符” 另一方面 if flexgrid1.row = 1 and flexgrid1.col = 2 and .CellBackColor = vbCyan then msgbox vbcyan else msgbox vbwhite End if 上述代码未显示在消息框中 如何解决这个问题 我的代码有什么问题。.CellBackColor获取/设置当前.Row/.Col的颜

使用Flexgrid

我想检查特定单元格的背景色

代码

上述代码将错误显示为“无效限定符”

另一方面

if flexgrid1.row = 1 and flexgrid1.col = 2 and  .CellBackColor = vbCyan then
    msgbox vbcyan
    else
    msgbox vbwhite
    End if
上述代码未显示在消息框中

如何解决这个问题


我的代码有什么问题。

.CellBackColor
获取/设置当前
.Row
/
.Col
的颜色,因此在询问之前,您必须将
.Row
/
.Col
设置为您正在查看的颜色:

With flexgrid1
   .Row = 1
   .Col = 2
   If .CellBackColor = vbCyan Then
      msgbox vbCyan
   Else
      msgbox vbWhite
   End If
End With 

你的msgbox声明是否符合犹太教?msgbox将字符串作为其参数

msgbox "colour is Cyan"

TextMatrix没有CellBackColor属性。msgbox VBCyn将显示一个带有16776960(VBCyn常量的数值)的消息框。如果这是您想要的,为什么还要使用if语句呢。msgbox.CellBackColor
msgbox "colour is Cyan"