MDI 폼으로 만들고있습니다.
자식폼이 여러개 있는데요.
MDI 메인폼에 톨바가 있습니다. 이툴바(버튼)를 이용 자식폼을 컨트롤 할려고합니다.
해당 자식폼에다 해당하는 버튼을 Enabled -> true 해주고요 버튼에 해당하는 코딩을 하면 에러가 나서
uses mc01; 을 자식폼에다 넣어서 했는데 잘안되서요.. ㅠ.ㅠ
도와주세요..
감사합니다.
unit mc01; (메인 폼)
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, ImgList, ComCtrls, ToolWin, StdCtrls;
type
TfrmMain = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
ToolBar1: TToolBar;
TBefore: TToolButton;
Tinsert: TToolButton;
Tdelete: TToolButton;
ToolButton4: TToolButton;
TSave: TToolButton;
TSearch: TToolButton;
TPrint: TToolButton;
ToolButton8: TToolButton;
TExit: TToolButton;
ImageList1: TImageList;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
N11: TMenuItem;
StatusBar1: TStatusBar;
N12: TMenuItem;
N13: TMenuItem;
Tsearch1: TToolButton;
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure TExitClick(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N9Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormDestroy(Sender: TObject);
procedure N13Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8;
{$R *.DFM}
procedure TfrmMain.N2Click(Sender: TObject);
var
child : TTmenu_01;
i : integer;
OldCursor : TCursor;
begin
TBefore.Enabled := true;
TSave.Enabled := true;
Tinsert.Enabled := true;
Tsearch.Enabled := false;
Tdelete.Enabled := true;
Tsearch1.Enabled := false;
Tprint.Enabled := true;
for i := 0 to MDIChildCount -1 do
if MDIChildren[i] is TTmenu_01 then
begin
MDIChildren[i].show;
exit;
end;
OldCursor := screen.cursor;
screen.cursor := crhourglass;
try
child := TTmenu_01.create(application);
{ 현재 페이지 작업 공간 }
finally
screen.cursor := oldcursor;
end;
end;
procedure TfrmMain.N3Click(Sender: TObject);
var
child : TTmenu_02;
i : integer;
OldCursor : TCursor;
begin
TBefore.Enabled := true;
TSave.Enabled := false;
Tinsert.Enabled := false;
Tsearch.Enabled := true;
Tdelete.Enabled := true;
Tsearch1.Enabled := false;
Tprint.Enabled := true;
for i := 0 to MDIChildCount -1 do
if MDIChildren[i] is TTmenu_02 then
begin
MDIChildren[i].show;
exit;
end;
OldCursor := screen.cursor;
screen.cursor := crhourglass;
try
child := TTmenu_02.create(application);
{ 현재 페이지 작업 공간 }
finally
screen.cursor := oldcursor;
end;
end;