Timer timer;
int autoCloseInterval = 5;
int count = 0;
private void radButton1_Click(object sender, EventArgs e)
{
timer = new Timer();
timer.Interval = 1000;
timer.Tick += timer_Tick;
timer.Start();
RadMessageBox.Show("Warning", "Are you sure you want to quit?", MessageBoxButtons.YesNo, "Please don't quite yet!");
}
private void timer_Tick(object sender, EventArgs e)
{
count++;
RadMessageBox.Instance.Controls["radButton1"].Text = "Yes (" + (autoCloseInterval - count) + ")";
if (count > autoCloseInterval)
{
timer.Stop();
RadMessageBox.Instance.Close();
}
}
Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.