Board index » delphi » Name property on TForm

Name property on TForm

Has anyone had an trouble referencing the Name property of a Form?
Ever time I try to access the Name (show below), nothing is returned.

formname := Screen.ActiveForm.Name;

Does anyone have the URL of the Delphi site which maintains the list
of known bugs?

Thanks,

Mike Williams
mlwil...@ix.netcom.com

 

Re:Name property on TForm


"formname := Screen.ActiveForm.Name"

Name is a property of form, not of screen.  Try:

formname := frmMyForm.name;

where formname is a string variable and frmMyForm is the name of the form.

Jim

Re:Name property on TForm


Quote
mas...@nyc.pipeline.com (Jim Clokey) wrote:
>"formname := Screen.ActiveForm.Name"

>Name is a property of form, not of screen.  

        Um, actually name is a property of TForm and Screen.ActiveForm is
of type TForm so this should be OK. If the types were off it would be a type
mismatch error but it isn't.
        When I look at Length(screen.activeForm.Name) I get 0. (???)

Quote
>Try:

>formname := frmMyForm.name;

>where formname is a string variable and frmMyForm is the name of the form.

        I get the same results.

??? anyone?

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Re:Name property on TForm


Quote
>I know that Form1.Name returns an empty string at runtime,

        So it would appear. Does this make sense to you (and if yes could
you explain it to me?)

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Re:Name property on TForm


Quote
mlwil...@ix.netcom.com (Michael Williams) wrote:
>Has anyone had an trouble referencing the Name property of a Form?
>Ever time I try to access the Name (show below), nothing is returned.
>formname := Screen.ActiveForm.Name;
>Does anyone have the URL of the Delphi site which maintains the list
>of known bugs?
>Thanks,
>Mike Williams
>mlwil...@ix.netcom.com

Hi Mike,

I know that Form1.Name returns an empty string at runtime, so I
suspect that Screen.ActiveForm.Name also has this "feature".
Regards Niek.

=====================================================================
Niek de Ruijter                       E-mail: niekr...@worldaccess.nl
Poternestraat 6                       phone: 0162 - 516163
4931 CN Geertruidenberg
Netherlands

Re:Name property on TForm


On 16 Dec 1995 18:14:24 GMT, David Ullrich <ullr...@math.okstate.edu>
wrote:

Quote
>>I know that Form1.Name returns an empty string at runtime,

>    So it would appear. Does this make sense to you (and if yes could
>you explain it to me?)

You can create multiple instances of the same form at run-time. If
they all have the same Name, what purpose does the Name property
serve? The Name just tells you the type of the form (minus a leading
'T'). If you need a unique identifier for every form instance at
run-time, you need to manage that yourself. The Name property cannot
help you.

--
Ray Lischner         (li...@tempest-sw.com)
Tempest Software, Corvallis, Oregon, USA

Re:Name property on TForm


On Sat, 23 Dec 1995 19:04:37 GMT, li...@tempest-sw.com (Ray Lischner)
wrote:

Quote
>You can create multiple instances of the same form at run-time. If
>they all have the same Name, what purpose does the Name property
>serve? The Name just tells you the type of the form (minus a leading
>'T'). If you need a unique identifier for every form instance at
>run-time, you need to manage that yourself. The Name property cannot
>help you.

>--
>Ray Lischner         (li...@tempest-sw.com)
>Tempest Software, Corvallis, Oregon, USA

Regardless of the purpose, the fact remains that there seems to be a
problem accessing the Name property.  

I believe, with a little creativity, you might be able to come up with
a useful purpose for accessing the Name proprety -- I did.

Mike Williams
mlwil...@ix.netcom.com

Other Threads