How to communicate among frames and within a frame?
For example: a Frame 1 and a Frame 2.
The frame 2 is in the frame 1. To insert the frame 2 into the frame 1 I add frames from ToolPalette ->
type
TFrame1 = class(TFrame)
Frame22: TFrame2;
var MyFrame1:TFrame1; // Now I can access to everything within a frame and from other frames too
implementation
But I have an error trying to access to MyFrame1 and to do something like MyFrame1.Button1.Enable within the frame 1 or from other frames:
“Exception class EAccessViolation with a message ‘Access violation at address 0084858C in module ‘P1.exe'”
How to access to the frame 1 from the frame 2? MyFrame1->Error.
Thanks!
Please delete the global variable declaration:
It usually makes no sense for frames.
You can typecast the child frame’s
OwnertoTFrame1, for example: