Click to See Complete Forum and Search --> : One instance of a window


lloydy
August 4th, 2004, 02:55 AM
Hi,

I have a tree list, and have set a double click to get a User Form( of type Series2RTUControl), which I then use. The problem is, I only want one instance of the user form. I have tried the following code :


//In the class that handles the double click
if(this->_control == 0)
{
this->_control = new Series2RTUControl();
return(dynamic_cast<UserControl *>(_control));
}else
{
return 0;
}

This works, however when the User closes the form, the _control is not set to 0, so the form cannot be reopened.

Please help

Lloydy