도움을 바랍니다.
버튼에서 자식 창을 생성하고 텍스트 화일을 올릴려고 하는데 에러가 나는군요.
아래와 같이 했는데 안되요.
procedure TMainForm.Bible1Click(Sender: TObject);
begin
CreateMDIChild('NONAME' + IntToStr(MDIChildCount + 1));
end;
혹시 몰라서 전체 소스를 올립니다. 이제 시작이어서 길지는 않습니다.
굵게 나오는 부분입니다. 볼드로 나오려나?
unit Main;
interface
uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Menus, ImgList;
type
TMainForm = class(TForm)
MainMenu: TMainMenu;
EditUndoItem: TMenuItem;
EditCopyItem: TMenuItem;
WindowTileItem: TMenuItem;
WindowArrangeItem: TMenuItem;
HelpContentsItem: TMenuItem;
HelpSearchItem: TMenuItem;
HelpHowToUseItem: TMenuItem;
HelpAboutItem: TMenuItem;
SpeedBar: TPanel;
SpeedButton1: TSpeedButton; { &Copy }
SpeedButton2: TSpeedButton; { &Tile }
SpeedButton3: TSpeedButton; { &Contents }
SpeedButton4: TSpeedButton;
Secenek1: TMenuItem;
Bible1: TMenuItem;
Bible2: TMenuItem;
Bible3: TMenuItem;
Bible4: TMenuItem;
Bible5: TMenuItem;
AramaMotr1: TMenuItem;
N1: TMenuItem;
N2: TMenuItem;
Dil1: TMenuItem;
N4: TMenuItem;
Kapat1: TMenuItem;
ImageList1: TImageList;
Button1: TButton;
Panel1: TPanel;
Button2: TButton;
Button3: TButton;
Button4: TButton;
ComboBox1: TComboBox;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton; { &About... }
procedure EditUndo(Sender: TObject);
procedure EditCut(Sender: TObject);
procedure EditCopy(Sender: TObject);
procedure EditPaste(Sender: TObject);
procedure WindowTile(Sender: TObject);
procedure WindowCascade(Sender: TObject);
procedure WindowArrange(Sender: TObject);
procedure HelpContents(Sender: TObject);
procedure HelpSearch(Sender: TObject);
procedure HelpHowToUse(Sender: TObject);
procedure HelpAbout(Sender: TObject);
procedure Kapat1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Bible1Click(Sender: TObject);
procedure Dil1Click(Sender: TObject);
end;
var
MainForm: TMainForm;
implementation
{$r *.dfm}
procedure TMainForm.EditUndo(Sender: TObject);
begin
{ Add code to perform Edit Undo }
end;
procedure TMainForm.EditCut(Sender: TObject);
begin
{ Add code to perform Edit Cut }
end;
procedure TMainForm.EditCopy(Sender: TObject);
begin
{ Add code to perform Edit Copy }
end;
procedure TMainForm.EditPaste(Sender: TObject);
begin
{ Add code to perform Edit Paste }
end;
procedure TMainForm.WindowTile(Sender: TObject);
begin
Tile;
end;
procedure TMainForm.WindowCascade(Sender: TObject);
begin
Cascade;
end;
procedure TMainForm.WindowArrange(Sender: TObject);
begin
ArrangeIcons;
end;
procedure TMainForm.HelpContents(Sender: TObject);
begin
Application.HelpCommand(HELP_CONTENTS, 0);
end;
procedure TMainForm.HelpSearch(Sender: TObject);
const
EmptyString: PChar = '';
begin
Application.HelpCommand(HELP_PARTIALKEY, Longint(EmptyString));
end;
procedure TMainForm.HelpHowToUse(Sender: TObject);
begin
Application.HelpCommand(HELP_HELPONHELP, 0);
end;
procedure TMainForm.HelpAbout(Sender: TObject);
begin
{ Add code to show program's About Box }
end;
procedure TMainForm.Kapat1Click(Sender: TObject);
begin
Close;
end;
procedure TMainForm.Button1Click(Sender: TObject);
begin
Panel1.Visible :=True ;
end;
procedure TMainForm.Bible1Click(Sender: TObject);
begin
CreateMDIChild('NONAME' + IntToStr(MDIChildCount + 1));
end;
procedure TMainForm.Dil1Click(Sender: TObject);
begin
end;
end.
procedure TForm_Main.CreateMDIChild(const Name: string);
var Child: TForm_Child;
begin
Child := TForm_Child.Create(Application);
Child.Caption := Name;
end;
머.. 이런식으로 만들어 추가시키면 되겠네요..^^;;