Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you RENAME a form with grayed out name

Status
Not open for further replies.

fmoore0001

Programmer
Dec 3, 2002
192
US
Guys, I have a question on a thread that started earlier. I have a form with a grayed out .name property, apparently from a class. I cannot change the .name property, but would like to as the class is used to create multiple forms, all with the same .name.

Any idea how I can rename these forms.

Frank
 
Let's say you wanted every form to have a unique name...you could put the following in the init event of the form/form class...

thisform.Name = "frm"+SUBSTR(SYS(2015), 4)

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
Hi Frank.

>> I cannot change the .name property, but would like to as the class is used to create multiple forms, all with the same .name. <<

You can add a property called cFormID to your base form class. Assuming that you have a form manager to manage all the forms that get launched in the application, you can use this property to differentiate between different instances of the same form class.

Also, if you are launching multiple instances of the same form, you can tack some identitfying text on to the form caption so, if your application has a window menu, you can display the different forms as "Customer Information for Anita Drink", "Customer Information for Justin Trouble", and so on...




Marcia G. Akins
 
Marcia, I think you just solved a million dollar problem.

Now, how do I get around checking for forms that do NOT have the cFormID as a property. Is there a way in the form to precheck if a form has a particular property existing?


Frank
 
Check out PEMSTATUS() in the help file.

boyd.gif

craig1442@mchsi.com
&quot;Whom computers would destroy, they must first drive mad.&quot; - Anon​
 
I'd like to clarify something here. Is it the form's name property that's grayed out, or is it an object on the form? What would cause this is when you have a container type of class, and you have objects defined in that class, you cannot rename those objects when you instantiate the class. For generic things like pages in a pageframe or options in an option group, I define my base clase with 0 pages or 0 buttons, and define the number of pages or buttons in the instance. Then I name name the pages or buttons whatever I want from the property sheet for the instance.


-BP (Barbara Peisch)
 
I found a solution for my problem and it is in:

thread184-794453

Thank you for all your help.

Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top