To reproduce: use the following code:
RadDesktopAlert desktopAlert = new Telerik.WinControls.UI.RadDesktopAlert();
public Form1()
{
InitializeComponent();
desktopAlert.AutoClose = false;
RadButtonElement radButtonElement = new RadButtonElement();
radButtonElement.Click += RadDesktopAlertOkButtonClick;
radButtonElement.Text = "OK";
desktopAlert.ButtonItems.Add(radButtonElement);
desktopAlert.PopupAnimationDirection = RadDirection.Up;
desktopAlert.PopupAnimationEasing = Telerik.WinControls.RadEasingType.InBack;
BackgroundWorker bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
bw.RunWorkerAsync();
}
private void CreateAndShowAlert(string caption, string text)
{
desktopAlert.CaptionText = caption;
desktopAlert.ContentText = text;
desktopAlert.Show();
}
void RadDesktopAlertOkButtonClick(object sender, EventArgs e)
{
desktopAlert.Hide();
}
void bw_DoWork(object sender, DoWorkEventArgs e)
{
int i = 0;
while (true)
{
Thread.Sleep(1000);
i++;
MethodInvoker mi = new MethodInvoker(delegate() { this.CreateAndShowAlert("Alert " + i, "This is the " + i + "th alert"); });
this.Invoke(mi);
}
}
When I click the OK button, the DesktopAlert hides correctly, but after a few times (10 or more) the DesktopAlert stops appearing.
Workaround:
radDesktopAlert.Hide();
radDesktopAlert.Show();
or to switch off the animation:
radDesktopAlert.PopupAnimation = false;