Gambas-it

Gambas3 => Programmazione => Topic aperto da: vuott - 10 Agosto 2013, 02:15:31

Titolo: Errore: "Message Box Already Displayed"
Inserito da: vuott - 10 Agosto 2013, 02:15:31
Riporto di seguito questa discussione apparsa nella Mailing List internazionale:

" In a fairly simple program I get this error (Message Box Already Displayed) when only one message box is displayed.

Is there a known cause for this?

PICCORO McKAY Lenz
"


" The cause is that you *want* to display another one... This sometimes
happens to me when I display a Message box from an event handler. It seems,
while the Message box is displayed (waiting for the user), the event loop is
called again and may dispatch the same event another time which will then
cause your error.

I personally use this construct to serialise these Message boxes:


Codice: gambas [Seleziona]
Do
  Try Message.Error(("This was an error"))
While Error


instead of just

Codice: gambas [Seleziona]
Message.Error(("This was an error"))


Regards,
Tobi
"