1
I have the following problem, I am doing a popup to display on the screen information, almost in the same way as a ShowDialog()
, being so:
GeneralPopUp popupErro = new GeneralPopUp("Titulo", "Mensagem");
GeneralPopUp.ACTION_TYPE at = popupErro.ShowPopUp(parent);
And my intention is, to wait for his action inside the popup which is a Form
and then validate what was done as follows:
switch (at)
{
case GeneralPopUp.ACTION_TYPE.NULO:
break;
case GeneralPopUp.ACTION_TYPE.OK:
break;
case GeneralPopUp.ACTION_TYPE.FECHAR:
break;
case GeneralPopUp.ACTION_TYPE.EXTRA1:
break;
case GeneralPopUp.ACTION_TYPE.EXTRA2:
break;
default:
break;
}
But the way I’m doing it, it doesn’t wait for the actions to occur inside this form and then enter my switch, I’ll probably have to make an Handler for this situation.
What is the best way to do this Handler? If not, what is another solution?
I made her, she’s mine.
– Enzo Tiezzi
but this way I can make my code wait for the answer of this popup to continue?
– Enzo Tiezzi
Yes. If the popup is opened as a dialog, the control will only return to the parent form when the dialog is closed. And before being closed, it necessarily triggers the event
FormClosing
. Remember: you will treat the eventFormClosing
from the popup form, not from the parent.– Oralista de Sistemas
excellent!!!!!!
– Enzo Tiezzi