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
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
Is Screen.ActiveControl also nil?
> 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
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
LMD has answered:
A form is "downgraded" to a panel in a TLMDFormDisplay (and a panel has no
ActiveControl property) ...
bye,
Helmut
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