Good day guys, I'm a semi-intermediate here in c#. Actually, the said topic name it won't work with my codes implemented, i need some help on how to improve my timer tick procedure code as shown what I've tried below.
- private void timer1_Tick(object sender, EventArgs e)
- {
- statmessage();
- int i = listBox1.SelectedItems.Count + 1;
- do
- {
- var exp = (EItem)listBox1.Items[i];
- var timeVisible = DateTime.Now - exp.Added;
- if (timeVisible.TotalSeconds > 5)
- if (counter == 100)
- {
- SendMessage();
- counter = counter - 1;
- ++i;
- }
- else if (counter <= 0)
- {
- statmessage();
- }
- } while (i < -1);
- }
- }
- }
Your feedback is highly appreciated and will help to improve the said concern, Thank you very much.

Amit GuptaRank #190 · 12.8K reputationPosted Jan 31, 2019, 4:40 AM EST
leo ochoa54 reputationPosted Jan 31, 2019, 6:59 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Jan 31, 2019, 8:18 PM EST