Completed
Last Updated: 29 Jun 2016 05:49 by ADMIN
ADMIN
Hristo
Created on: 02 Jun 2016 12:54
Category: Form
Type: Bug Report
0
FIX. RadMessageBox - if there is already shown RadMessageBox calling the static Show method a second time results in an exception
How to reproduce:
public partial class Form1 : Form
{
    Timer timer;

    public Form1()
    {
        InitializeComponent();

        timer = new Timer();
        timer.Interval = 1000; 
        timer.Tick += new EventHandler(MyTimer_Tick);
        timer.Start();
    }

    protected override void OnShown(EventArgs e)
    {
        base.OnShown(e);

        RadMessageBox.Show("Shown");
    }

    private void MyTimer_Tick(object sender, EventArgs e)
    {
        RadMessageBox.Show("Form closed");
        this.Close();
    }
}

Workaround: dispose the old instance
private void MyTimer_Tick(object sender, EventArgs e)
{
    RadMessageBox.Instance.Dispose();

    RadMessageBox.Show("Form closed");
    this.Close();
}
0 comments