<div dir="ltr"><div>Nice explanation.</div><div><br></div><div>Thank you very much.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 30, 2024 at 4:20 PM Marc Weustink via lazarus <<a href="mailto:lazarus@lists.lazarus-ide.org">lazarus@lists.lazarus-ide.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The onenter is indeed fired when the control gets focus. However if you show a dialog in that event, the control loses focus and gets it again when the dialog is closed, resulting in a loop.<br>
In general it is bad coding to have much logic in onenter/onleave events <br>
<br>
I once was confronted with an app which checked if you didn't leave an empty mandatory edit. If so, the app set the focus back to the control you left. But if you navigated to the next empty mandatory edit it ran into an endless loop focussing both edits <br>
<br>
Marc<br>
<br>
On March 30, 2024 1:50:14 PM GMT+01:00, "Arí Ricardo Ody via lazarus" <<a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a>> wrote:<br>
>I was thinking that OnEnter would refer to receiving focus. If it responds<br>
>to mouse movement then it is explained.<br>
><br>
>I changed the logic to use the OnClick event in the component. Then it<br>
>worked.<br>
><br>
>I see now that it was a lack of knowledge on my part.<br>
><br>
>Thank you very much.<br>
><br>
>On Fri, Mar 29, 2024 at 9:03 AM Werner Pamler via lazarus <<br>
><a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a>> wrote:<br>
><br>
>> Am 29.03.2024 um 12:09 schrieb Arí Ricardo Ody via lazarus:<br>
>> > procedure TfrmGeraString.tedtNomArqMicEnter(Sender: TObject);<br>
>> The "Enter" in this method name indicates that you assigned the event<br>
>> handler to the OnEnter event of something (a button maybe). This means<br>
>> that whenever the mouse is moved over this button ("enter") the event<br>
>> fires. Usuall dialogs are displayed only when a "click" occurs, and this<br>
>> responsibility is in the OnClick event of the button.<br>
>> --<br>
>> _______________________________________________<br>
>> lazarus mailing list<br>
>> <a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a><br>
>> <a href="https://lists.lazarus-ide.org/listinfo/lazarus" rel="noreferrer" target="_blank">https://lists.lazarus-ide.org/listinfo/lazarus</a><br>
>><br>
-- <br>
_______________________________________________<br>
lazarus mailing list<br>
<a href="mailto:lazarus@lists.lazarus-ide.org" target="_blank">lazarus@lists.lazarus-ide.org</a><br>
<a href="https://lists.lazarus-ide.org/listinfo/lazarus" rel="noreferrer" target="_blank">https://lists.lazarus-ide.org/listinfo/lazarus</a><br>
</blockquote></div>