Jump to content

Verificar Cor de Célula em Datagrid para Executar Contagem


Chamuanza
Go to solution Solved by Chamuanza,

Recommended Posts

Um Bem Aja a todos

Tenho necessidade de fazer uma contagem das celulas a Amarelo da  SaidosEuroDreamsDataGridView, mas não consigo, alguem me dê uma ajuda.

Tenho este código no Private Sub frmGraficoPremiosEuroDream_Load(sender As Object, e As EventArgs) Handles MyBase.Load

 'Conta os numeros do Premiados
        Dim yContagem(40) As Integer

        For i As Integer = 1 To 40
            For Linhas = 0 To SaidosEuroDreamsDataGridView.RowCount - 1

                For Colunas = 1 To 6
                         If SaidosEuroDreamsDataGridView.DefaultCellStyle.BackColor=??????? Then
                        yContagem(i) += 1
                    End If

                Next Colunas

                For Colunas = 1 To 6

                Next Colunas

            Next Linhas
        Next i
Edited by Chamuanza
Mostar Resolução
Link to comment
Share on other sites

  • Solution
 For i As Integer = 1 To 49
            For Linhas = 0 To frmApostasPremiadasTotoloto.DataGridView1.RowCount - 1
                For Colunas = 1 To 5
                    If frmApostasPremiadasTotoloto.DataGridView1.Item(Colunas, Linhas).Value = i Then

                        If frmApostasPremiadasTotoloto.DataGridView1.Item(Colunas, Linhas).Style.BackColor = Color.Yellow Then

                            yContagem(i) += 1

                        End If

                    End If
                Next Colunas
            Next Linhas
        Next i

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.