>>the _screen.objects(nindex)... allows to uniquely identify an object in the _scree but how can i know this 'nindex' for a form ?
>>Is there a command which returns this number ? i'd like to get it in the init event of the form.
>>
>The only way I know of is to create your own function that looks in the _Screen.Forms[] collection and finds the form based on some criteria you pass (e.g. form title or name). But at this point you have the form and can get an object reference to it as Erik suggested in another post.
>
>The following code will return an object reference to the desired form or a .NULL. variable.
>lparameters tcformname
>local luretval
>luretval = .NULL.
>for lxx = 1 to _Screen.FormCount
> With _Screen.Forms[lxx]
> if upper(.BaseClass) = "FORM" ;
> and upper(.Name) = upper(tcformname) then
> luretval = _Screen.Forms[lxx]
> endif
> Endwith
>endfor
>return luretval
Larry,
Unfortunately this wouldn't work with forms that are instantiated more than once as :
do form ...
where all instances of the form would have the same name.
Cetin