Sorry, for the topposting, but I'm on a Windows box right know. :( You never know what happens in event driven programs. So if the doubleclick event closes the form, it can happen that the control loses focus and so the OnExit is triggered. There is a simple solution to this and that is define a private property of your form which you send to true in the OnDoubleClick event. In the OnExit event you check this property and if it is true you leave the event method.
Matthijs -----Oorspronkelijk bericht----- Van: Alexander Todorov [mailto:[EMAIL PROTECTED] Verzonden: donderdag 30 maart 2006 13:45 Aan: [email protected] Onderwerp: [lazarus] OnExit, OnDblClick, Close with TDBGrid. Hello, I have a TDBGrid shown on a form, that lets the user select an item. OnDblClick event handler does the apropriate actions with the selected item and closes the form. I also have onExit event handler for the DBGrid. When the form is closed from within dblclick, onexit fires as well which i scausing me problems. Is this a bug or a feature? See attached test project. There is no difference if the second form is shown modal or not (Show vs ShowModal). In Delphi this does not happen. _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
