Formy, pomocy:)

0

Oprocz jednej glownej formy, tworze sobie inna i wszystko bylo by OK gdyby nie to ze korzystajac z drugiej formy, nie mam dostepu do zmiennych, ktore stworzylem w formie glownej:(
Jak zrobic zeby mozna bylo korzystac z tych zmiennych?
Z gory dzieki za odpowiedz..--take care,

Wodzu

0

A gdzie deklarujesz te zmienne? Nigdy nie używałem kilku form, ale jak je zadeklarujesz w sekcji public, to chyba powinno dzialać.--Delphi 4

Skysh The God, Your Slave

0

Juz nie trzeba, sam znalazlem:)

To add a form to your project, select File|New Form. You can see all your project’s forms and their associated units listed in the Project Manager (View|Project Manager) and you can display a list of the forms alone by choosing View|Forms.

Linking forms

Adding a form to a project adds a reference to it in the project file, but not to any other units in the project. Before you can write code that references the new form, you need to add a reference to it in the referencing forms’ unit files. This is called form linking.
A common reason to link forms is to provide access to the components in that form. For example, you’ll often use form linking to enable a form that contains data-aware components to connect to the data-access components in a data module.

To link a form to another form,

1 Select the form that needs to refer to another.
2 Choose File|Use Unit.
3 Select the name of the form unit for the form to be referenced.
4 Choose OK.

Linking a form to another just means that the uses clauses of one form unit contains a reference to the other’s form unit, meaning that the linked form and its components are now in scope for the linking form.

Avoiding circular unit references

When two forms must reference each other, it’s possible to cause a “Circular reference” error when you compile your program. To avoid such an error, do one of the following:

Place both uses clauses, with the unit identifiers, in the implementation parts of the respective unit files. (This is what the File|Use Unit command does.)
Place one uses clause in an interface part and the other in an implementation part. (You rarely need to place another form’s unit identifier in this unit’s interface part.)

Do not place both uses clauses in the interface parts of their respective unit files. This will generate the “Circular reference” error at compile time.--take care,

Wodzu

1 użytkowników online, w tym zalogowanych: 0, gości: 1