Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
Guest Laércio Sampaio

Mudar cores condicionalmente do FlexGrid vb6

Question

Guest Laércio Sampaio

Gostaria de saber se é possível e como se altera a cor do backcolor do msflexgrid de acordo com uma condição.

Ou seja;

Se o campo1 for = 1 então backcolor = vermelho

senão backcolor = amarelo

Obirgado!!!!!!

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Guest Laércio Sampaio

Já que ninguém respondeu, eu mesmo respondo. Rsrsrsrsrs

' Varrendo todas as linhas do flexgrid
            For i = 1 To MSHFlexGrid1.Rows - 1
            ' Verificando na linha, o conteúdo da coluna 6 (Onde está o tipo)
            ' Se for igual a Tratamento, coloca a coluna com a cor Vermelha e a fonte na cor Branca
        If MSHFlexGrid1.TextMatrix(i, 6) = "Tratamento" Then
        ' Varre todas as colunas da linha e seta a cor de fundo
For coluna = 0 To MSHFlexGrid1.Cols - 1
    MSHFlexGrid1.Col = coluna
    MSHFlexGrid1.Row = i
    MSHFlexGrid1.CellBackColor = &HC0&
    MSHFlexGrid1.CellForeColor = &H80000004
    Next coluna
    Next i

Edited by kuroi
Adicionar tag CODE

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Cloud Computing


  • Forum Statistics

    • Total Topics
      148561
    • Total Posts
      644241
×
×
  • Create New...