Autore Topic: Errore: "Message Box Already Displayed"  (Letto 233 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.269
  • Ne mors quidem nos iunget
    • Mostra profilo
Errore: "Message Box Already Displayed"
« il: 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
"
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »