Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replace all
Message
From
28/04/2005 08:30:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
28/04/2005 06:52:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 5
Miscellaneous
Thread ID:
01009144
Message ID:
01009168
Views:
14
>hi all,
>
>how i can change all titles or headers for my forms and reprorts.
>
>as if a company name is "TEL.COMPANY", i can see this name for every form and report , if i want to change this name to any name via change this label or text. as one time .
>
>THANKS.

To change this easily for an entire program, different titles for different clients, you need to have a public variable, or constant, in the first place, and use it in all relevant forms and menus.

You can have a public variable (or, perhaps better, a property of your application object), with the name of the client. This variable can then be used in reports and forms.

Let's say your application object is called goApp, and it has a property called goApp.CompanyName. (An application object is simply an object that stores information about the application in general.)

For a form, you could use: ThisForm.Caption = goApp.CompanyName. Similarly, in a report you could include a field with goApp.CompanyName as a report expression.

The global variable or application object can obtain its data in several ways:
  • You can hardcode it in your program.
  • You can read a value from a text file or DBF.
  • You can read a value from a constant (see in help: #define and #include). (You could also use this constant directly, instead of a global variable or application object.)

    HTH,

    Hilmar.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform