我想在MSFlexGrid允许选择多个格,用不同的颜色表示,还可以去掉选择,就是变回原来的颜色。
并且有的格不允许选,就是选的时候不变色。
同时我要知道选中了哪些格?刚学vb,很菜,谢谢了

解决方案 »

  1.   

    用cellbackcolor只能实现一格一格的改变,如果我想要通过拖动鼠标来同时改变很多怎么办?
    借搂主的地方问了个问题,谢谢
      

  2.   

    还有,数据多的时候,1000多行,显示速度很慢,请问如何提高。代码如下:  'msgURight  就是 msflexgrid 控件
      Rst.Open sql, Conn, 1
        If Not Rst.EOF Then
            'F.msgURight.Rows = F.msgURight.Rows + Rst.RecordCount
            'F.msgGRight.DataSource=
          Do While Not Rst.EOF
            F.msgURight.Rows = F.msgURight.Rows + 1
            Row = Row + 1
            F.msgURight.RowHeight(Row - 1) = 300
            With F.msgURight
              .Row = Row - 1
              .Col = 0
              .CellForeColor = &HFF&
              .Text = Trim(Rst.Fields(1).Value)
              .RowData(Row - 1) = Rst.Fields(0).Value
            End With
           
            If IsNull(Rst.Fields("rightvalue").Value) Then   'È¡µÃµ±Ç°À¸Ä¿µÄȨÏÞÖµ£¡
              TempRV = 0
            Else
              TempRV = CInt(Rst.Fields("rightvalue").Value)
            End If
            
            If (TempRV And 128) = 128 Then
              With F.msgURight
                .Row = Row - 1
                .Col = 1
                .CellPictureAlignment = 4
                Set .CellPicture = F.ilsgrd.ListImages(1).Picture
              End With
            End If
            If (TempRV And 64) = 64 Then
              With F.msgURight
                .Row = Row - 1
                .Col = 2
                .CellPictureAlignment = 4
                Set .CellPicture = F.ilsgrd.ListImages(1).Picture
              End With
            End If
            For TempI = 0 To Col - 4         '¼ÆËãÆäËûȨÏÞ
              If (TempRV And 2 ^ TempI) = 2 ^ TempI Then
                With F.msgURight
                  .Row = Row - 1
                  .Col = TempI + 3
                  .CellPictureAlignment = 4
                  Set .CellPicture = F.ilsgrd.ListImages(1).Picture
                End With
              End If
            Next
            
            F.msgURight.TextMatrix(Row - 1, 0) = Trim(Rst.Fields(1).Value)
            Rst.MoveNext
          Loop
        End If
      Rst.Close借楼主的地方问,谢谢。