Board index » delphi » TEdit & events - slowly going insane

TEdit & events - slowly going insane

Is it normal for OnEnter to only get called when a user tabs into a TEdit,
rather than clicking into it?   Given that the help claims OnEnter is
triggered when a control receives focus, it seems that it should get called
whenever the cursor ends up in the TEdit, regardless of how it got there,
yet this does not seem to be happening here.

If OnEnter does only respond to a 'tabbed' entry, is there any equivalent
of the Visual Basic "GotFocus" event for a TEdit?   It seems crazy to have
to put a call to Edit1Enter in Edit1Click and so on, just to get desired
behaviour.

TIA,

Pete
(in a personal capacity)

 

Re:TEdit & events - slowly going insane


Quote
>Is it normal for OnEnter to only get called when a user tabs into a TEdit,
>rather than clicking into it?   Given that the help claims OnEnter is
>triggered when a control receives focus, it seems that it should get called
>whenever the cursor ends up in the TEdit, regardless of how it got there,
>yet this does not seem to be happening here.

>If OnEnter does only respond to a 'tabbed' entry, is there any equivalent
>of the Visual Basic "GotFocus" event for a TEdit?   It seems crazy to have
>to put a call to Edit1Enter in Edit1Click and so on, just to get desired
>behaviour.

>TIA,

>Pete
>(in a personal capacity)

Hmmm... Sorry about this one Pete.  I run Delphi 3 C/S and use the OnEnter
event handler constantly - seems to work whether tabbed into or from a mouse
click.  Anything else that could be the culprit?

Re:TEdit & events - slowly going insane


Quote
> Hmmm... Sorry about this one Pete.  I run Delphi 3 C/S and use the
OnEnter
> event handler constantly - seems to work whether tabbed into or from a
mouse
> click.  Anything else that could be the culprit?

Not that I can see, but ...

To be fair, OnExit seems to work as I would expect, so I guess there must
be something stuffing up the OnEnter somewhere- I'm just beggared if I can
find it.   Back to the magnifying glass, I suppose :-|

Thanks for the info, though - at least I know it's likely to be something
at this end, rather than a twisted feature of the language.

Cheers,

Pete
(in a personal capacity)

Re:TEdit & events - slowly going insane


Yes it should be fired when you enter it by clicking or by tabbing.  To
confirm this isn't a Delphi problem on your machine just create a dummy app
with a couple of edits and a lable and put some code in the OnEnter for the
edits which will change the lable.  

  Lable1.Caption := 'Edit1 entered';

Should do it.

Hope this helps!
--

Rodney E Geraghty
GERA-Tech
Ottawa, Canada
gera...@ibm.net

BEC <b...@beclondon.co.uk> wrote in article
<01bd5e37$877bed60$a15108c3@fred>...

Quote
> Is it normal for OnEnter to only get called when a user tabs into a
TEdit,
> rather than clicking into it?   Given that the help claims OnEnter is
> triggered when a control receives focus, it seems that it should get
called
> whenever the cursor ends up in the TEdit, regardless of how it got there,
> yet this does not seem to be happening here.

> If OnEnter does only respond to a 'tabbed' entry, is there any equivalent
> of the Visual Basic "GotFocus" event for a TEdit?   It seems crazy to
have
> to put a call to Edit1Enter in Edit1Click and so on, just to get desired
> behaviour.

> TIA,

> Pete
> (in a personal capacity)

Re:TEdit & events - slowly going insane


Rodney,

Thanks for the confirmation.   A little test app did indeed show that it
works as I would expect, which means something must be screwy in the code
of the troublesome project.   I shall have to have a good look at it,
obviously.

Cheers,

Pete

Re:TEdit & events - slowly going insane


Quote
p...@drufus.cix.co.uk (Pete Croft) wrote:
>>Thanks for the confirmation.   A little test app did indeed show that it
>>works as I would expect, which means something must be screwy in the code
>>of the troublesome project.   I shall have to have a good look at it,
>>obviously.

Just so you know you're not insane, I ran into this a long time ago
to.  Unfortnately I do not remember what the problem was in my code,
but it _was_ of my own doing. :(  

Good luck!

Christopher

Other Threads