Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ActiveControl: how to use it?

1,858 views
Skip to first unread message

helmut woess

unread,
Aug 27, 2005, 2:17:58 PM8/27/05
to
Hello,

i am working with D7 on XP and want to get the actual focused object. I
tried to use ActiveObject, but no matter what i do, ActiveObject is always
nil (i checked this in the onEnter event of an edit field - still nil).
Why?

tia,
Helmut

Peter Below (TeamB)

unread,
Aug 28, 2005, 6:14:23 AM8/28/05
to

Because you cannot make up your mind whether to use activeControl or
ActiveObject? ActiveControl is definitely not nil inside the OnEnter event
of a Twincontrol, if the form is visible and has focus, of course.

Note that the situation is a bit more complicated if you embed a form inside
another control by assigning that control to its Parent property. In this
case the embedded forms Activecontrol is not used, you have to look at the
host forms Activecontrol.


--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be


Kostas Terzides

unread,
Aug 28, 2005, 10:01:28 AM8/28/05
to
> When the cursor is outside in the field of the main form, ActiveControl is
> set. If the focus is on a field inside this embedded Form, ActiveControl is
> always nil. But when i check activeControl from the main form it is also
> nil. So i will speak with the component producer, how to get this value.


Is Screen.ActiveControl also nil?

helmut woess

unread,
Aug 28, 2005, 9:48:13 AM8/28/05
to
Am Sun, 28 Aug 2005 12:14:23 +0200 schrieb Peter Below (TeamB):

> In article <1ib1wk2dngktb.pyob5c1k25wu$.d...@40tude.net>, Helmut woess wrote:
>> i am working with D7 on XP and want to get the actual focused object. I
>> tried to use ActiveObject, but no matter what i do, ActiveObject is always
>> nil (i checked this in the onEnter event of an edit field - still nil).
>> Why?
>
> Because you cannot make up your mind whether to use activeControl or
> ActiveObject? ActiveControl is definitely not nil inside the OnEnter event
> of a Twincontrol, if the form is visible and has focus, of course.
>
> Note that the situation is a bit more complicated if you embed a form inside
> another control by assigning that control to its Parent property. In this
> case the embedded forms Activecontrol is not used, you have to look at the
> host forms Activecontrol.

I think you are right. I could drill down the problem. It happens only when
the focus is in an embedded form. I use a pagecontrol in the main form and
on every tabsheet i have a third party TFormDisplay component to display
another form.

thanks for your help,
Helmut

helmut woess

unread,
Aug 28, 2005, 2:05:13 PM8/28/05
to

Yes, is also nil. You can try it if you want. It happens when using
TLMDFormDisplay (from LMD Ext) from the free LMD-Tools SE 7.02,
downloadable at www.lmdtools.com
But i wrote a message to LMD, will see, what happens.

bye,
Helmut

helmut woess

unread,
Aug 28, 2005, 2:20:25 PM8/28/05
to


LMD has answered:
A form is "downgraded" to a panel in a TLMDFormDisplay (and a panel has no
ActiveControl property) ...

bye,
Helmut

helmut woess

unread,
Sep 1, 2005, 2:31:51 AM9/1/05
to

For all people reading this thread - the finish: it was a problem in my
program which i could not find out, but after some tests and changes at
once i got the correct value in Screen.ActiveControl. Thanks to the great
support from LMD.

Helmut

0 new messages