[prev in list] [next in list] [prev in thread] [next in thread]
List: gambas-user
Subject: Re: [Gambas-user] Strange behaviour of LostFocus event
From: Jussi Lahtinen <jussi.lahtinen () gmail ! com>
Date: 2010-06-22 14:07:11
Message-ID: AANLkTimFioUQDh39VuEnrH3X6S2V_mauEO-RH63TR6Fe () mail ! gmail ! com
[Download RAW message or body]
Why lostfocus is executed twice..?
Maybe something like this?
Public IsInUse as Boolean
Public Sub YourSub()
If IsInUse = False then
IsInUse = True
'Code here.
IsInUse = False
Endif
End
Jussi
On Tue, Jun 22, 2010 at 00:11, Leonardo Miliani
<leonardo@leonardomiliani.com> wrote:
> A friend of mine has written an application in which he has let the
> permission at the users to insert a text in the combobox textarea. Then,
> his code parses the text and, if there are errors, a message box is
> showed.
>
> The problem is that the LostFocus event is executed twice....
> In fact, Gambas tries to show another message box, but that is
> impossible because only 1 modal form can appears on the screen at once.
> So the program terminates and Gambas visualizes the error
> "Message box already displayed".
>
> This is the portion of code:
> PUBLIC SUB CodiceVoceContabile_LostFocus()
> .........bla.....bla.....bla.........................................
> FOR EACH RecTab
> IF RecTab!NomeVoce = $_VoceConto THEN
> i_CoVoMov = RecTab!NumVoce '--Codice di CONTO, corrispondente alla
> Voce contabile primaria
> i_UltCtogrup = i_CoVoMov + 999
> ENDIF
> IF i_CoVoMov > 0 THEN
> IF RecTab!NumVoce <= i_UltCtogrup THEN
> IF RecTab!NomeVoce = $_VoceSotCto
> i_CoVoMov = RecTab!NumVoce
> '-- Codice di SOTTOCONTO, corrispondente alla Voce contabile
> secondaria
> $_PartMovSiNo = RecTab!ContrPartSiNo
> BREAK
> ENDIF
> ELSE
> 'LabFrm2RicPiaCo:
> Message.Error("Attenzione! -> Record 'NON TROVATO'" & Chr(10) &
> Chr(10) & "durante la lettura della Tabella ContabFam.db!piancont'" &
> Chr(10) & Chr(10) & "in Form2.MovDigOk_Click.LabFrm2RicPiaCo" & Chr(10)
> & Chr(10) & " il programma verrą chiuso")
> QUIT
> ENDIF
> ENDIF
> NEXT
>
>
> --
> Leonardo Miliani
> www.leonardomiliani.com
>
> Webmaster e co-fondatore di www.gambas-it.org
> Il portale di riferimento per i programmatori Gambas italiani
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit. See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic