Delphi在子窗口合並菜單完整代碼:因為設計思路已經在上文中詳述,這裡只發代碼及注釋了,想參考之前的設計原理及思路,可參見這裡:Delphi在子窗口合並菜單 。
01
unit
MDIFrame;
02
interface
03
uses
04
SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
05
Menus;
06
type
07
08
private
09
10
public
11
12
end
;
13
var
14
FrameForm: TFrameForm;
15
implementation
16
uses
MDIEdit;
17
{$R *.DFM}
18
procedure
TFrameForm
.
Exit1Click(Sender: TObject);
19
begin
20
Close;
21
end
;
22
procedure
TFrameForm
.
New1Click(Sender: TObject);
23
begin
24
TEditForm
.
Create(Self);
25
end
;
26
procedure
TFrameForm
.
Tile1Click(Sender: TObject);
27
begin
28
Tile;
29
end
;
30
procedure
TFrameForm
.
Cascade1Click(Sender: TObject);
31
begin
32
Cascade;
33
end
;
34
procedure
TFrameForm
.
Arrangeicons1Click(Sender: TObject);
35
begin
36
ArrangeIcons;
37
end
;
38
procedure
TFrameForm
.
Open1Click(Sender: TObject);
39
begin
40
if
OpenFileDialog
.
Execute
then
41
with
TEditForm
.
Create(Self)
do
42
Open(OpenFileDialog
.
FileName);
43
end
;
44
end
.
編輯窗口單元文件:
vIEw source