Five records to display on the label sequentially

Israel

Active member
Joined
Jan 10, 2020
Messages
26
Programming Experience
Beginner
Hi,

I have a table, datagridview and a label on my form.
I need to display five records on my label one by one with 2 segunds of interval between them. How can I do?

ID | each_number
__________________
1 | 1
2 | 2
3 | 3
4 | 4
5 | 5

C#:
if (e.RowIndex >= 0)
{  
    DataGridViewRow row = this.dgvPGC.Rows[e.RowIndex];
    if (dgvPGC != null)  
       lblNumber.Text = row.Cells["each_number"].Value.ToString();
}
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
1,406
Location
Virginia Beach, VA
Programming Experience
10+
Use a timer.
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
1,406
Location
Virginia Beach, VA
Programming Experience
10+
I hope that your plan to do that dynamic display is not going to be very accessible to people with vision disabilities why they are using your application. A screen reader that the user is using may not be able to identify that you've updated a label and be able to read out the new text in time.
 
Top Bottom