Catching records in the DataGridView and playing on a label [closed]

1

Folks, my idea is this, I want to get records in a DataGridView and play on five labels. Each one corresponds to a command, and these labels will change to another record as soon as they are clicked.

Example:

  • Label1.Text = "Você gosta de programar?"; (The question label will have no action, it will only be changed by clicking on any of the others)
  • Label2.Text = "Gosto"; (This label will receive actions to add five points to users, it will change the text of all labels.)
  • Label3.Text = "Mais ou menos"; (This label will do the same as label2 .)
  • With the user click, the labels would pick up the next user record until all the records were gone.

    I tried to put a while with a variable by counting lines, but the label does not change its text.

    This is my current code:

    label1.Text = questoesTableAdapter.ConsultaPergunta(1);
    
    int numero_Linhas = dataGridView1.RowCount;
    int i =1;
    while (i < numero_Linhas)
    {
        label1.Text = questoesTableAdapter.ConsultaPergunta(i);
        label2.Text = i.ToString();
    
        ++i;
    }
    

    I'm just using two label's to test, one gets the counter, and the other the question text.

    My table is as follows:

        
    asked by anonymous 03.12.2015 / 03:49

    0 answers