Home > Back-end >  Give priority to build two Frame window, between the two Frame can refer to?
Give priority to build two Frame window, between the two Frame can refer to?

Time:09-17

Give priority to build two Frame window, between the two Frame can be reference to each other?

CodePudding user response:

Frame is based on the unit, between the two Frame can reference each other, like reference between the two units, is ok,

CodePudding user response:

An interface part USES an implementation part USES

CodePudding user response:

Two, if not, the Frame is not a window, and not a normal cell, seems to always be the main window,
Please detail,

CodePudding user response:

Sure, but according to your description, you could be access between two instances, the example of the as long as the reference to the other party access is ok, nothing much difficulty

CodePudding user response:

reference 4 floor yisuylm response:
of course, but according to your description, you could be access between two instances, this just reference each other instances of a visit, no difficulty

If so easy I would not have consulted here,

CodePudding user response:

Main Frame for nested, cannot be nested mutually, but the instance can visit each other

CodePudding user response:

refer to 6th floor yunzm_wang response:
Frame mainly to nested, each other can't each other nested, but examples can visit


In fact, the two main forms to establish Frame, each other can be reference in the USES, but doesn't seem to can visit each other, right?

CodePudding user response:

reference 5 floor hncdllyz reply:
Quote: refer to 4th floor yisuylm response:

Sure, but according to your description, you could be access between two instances, this just reference each other instances of a visit, no difficulty

If so easy I would not have consulted here,

Is really not complicated, shown in the code below, a custom variables each other, at the time of visit by casting finish visit:
 unit Unit2. 

Interface

USES the
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

Type
TFrame2=class (TFrame)
Edit1: TEdit;
Memo1: TMemo;
Private
FFrame3: TFrame;
Procedure visiteForm3;
{Private declarations}
Public
The property Frame3: TFrame read FFrame3 write FFrame3;
{Public declarations}
The end;

Implementation
USES Unit3.
{$R *. DFM}

Procedure TFrame2. VisiteForm3;
The begin
TFRame3 (Frame3). CheckBox1. Checked:=true;
The end;

End.
-- -- -- -- -- -- -- -- -- -- -- -- -- another Frame
The unit Unit3.

Interface

USES the
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

Type
TFrame3=class (TFrame)
CheckBox1: TCheckBox;
Private
FFrame2: TFrame;
{Private declarations}
Public
Procedure VisiteFrame2;
The property Frame2: TFrame read FFrame2 write FFrame2;
{Public declarations}

The end;

Implementation
USES Unit2.

{$R *. DFM}

Procedure TFrame3. VisiteFrame2;
The begin
TFrame2 (Frame2). Edit1. Text:='aaaaa';
The end;

End.
-- -- -- -- -- - the main unit of written
The unit Unit1;

Interface

USES the
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit3, Unit2;

Type
TForm1=class (TForm)
Frame21: TFrame2;
Frame31: TFrame3;
Procedure FormCreate (Sender: TObject);
Private
{Private declarations}
Public
{Public declarations}
The end;

Var
Form1: TForm1;

Implementation

{$R *. DFM}

Procedure TForm1. FormCreate (Sender: TObject);
The begin
Frame21. Frame3:=Frame31;
Frame31. Frame2:=Frame21;
The end;

End.




CodePudding user response:

According to the above code, I mean, Unit2, access between Unit3,

CodePudding user response:

references 9 f hncdllyz response:
according to the above code, I mean, Unit2, Unit3 access between

Difficult to understand what you mean, Unit2, Unit3 between access to implement the access to the instance, eventually I the code above is the instance access to each other, if you don't visit instance, what would you like to visit? Can you give an example

CodePudding user response:

references to the tenth floor yisuylm response:
Quote: references 9 f hncdllyz response:

According to the above code, I mean, Unit2, Unit3 access between

Difficult to understand what you mean, Unit2, Unit3 between access to implement the access to the instance, eventually I the code above is the instance access to each other, if you don't visit instance, what would you like to visit? You can for example

Your this sentence "" Unit2, Unit3 between visit to eventually implement the access to the instance," "said hit the nail on the head,

CodePudding user response:

11 references hncdllyz response:
Quote: reference to the tenth floor yisuylm response:

Quote: references 9 floor hncdllyz response:

According to the above code, I mean, Unit2, Unit3 access between

Difficult to understand what you mean, Unit2, Unit3 between access to implement the access to the instance, eventually I the code above is the instance access to each other, if you don't visit instance, what would you like to visit? You can for example

Your this sentence "" Unit2, Unit3 between visit to eventually implement the access to the instance," "said hit the nail on the head,

That not knot,
Procedure TForm1. FormCreate (Sender: TObject);
The begin
Frame21. Frame3:=Frame31;
Frame31. Frame2:=Frame21;
The end;
This code is the instance reference each other
  • Related