源程序
mainform)
unit MAIN;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, Menus,
StdCtrls, Dialogs, Buttons, Messages, ExtCtrls, ComCtrls, StdActns,
ActnList, ToolWin, ImgList,shellapi, KsHooks, KsForms, KsSkinForms,
KsSkinEngine, KsControls, KsMenus, KsSkinMenus, KsItems, KsSkinItems,
KsToolBars, KsSkinToolBars, XPBarMenu, KsSpeedButtons, KsSkinSpeedButtons,
KsControlBars, KsSkinControlBars;
type
TMainForm = class(TForm)
OpenDialog: TOpenDialog;
StatusBar: TStatusBar;
ImageList1: TImageList;
SeSkinEngine1: TSeSkinEngine;
SeSkinForm1: TSeSkinForm;
SeSkinMenuBar1: TSeSkinMenuBar;
file1: TSeSkinItem;
edit1: TSeSkinItem;
research1: TSeSkinItem;
complie1: TSeSkinItem;
windows1: TSeSkinItem;
about: TSeSkinItem;
filenewitem: TSeSkinItem;
fileopenitem: TSeSkinItem;
filesaveitem: TSeSkinItem;
filesaveasitem: TSeSkinItem;
fileprintitem: TSeSkinItem;
filecloseitem: TSeSkinItem;
editcutitem: TSeSkinItem;
editcopyitem: TSeSkinItem;
editpasteitem: TSeSkinItem;
WindowCascadeItem: TSeSkinItem;
windowtileitem: TSeSkinItem;
CustomItem1: TSeSkinItem;
CustomItem2: TSeSkinItem;
editallitem: TSeSkinItem;
WindowTileItem2: TSeSkinItem;
CustomItem3: TSeSkinItem;
SeSkinToolBar1: TSeSkinToolBar;
btsysitem: TSeSkinSpeedButton;
btnewitem: TSeSkinSpeedButton;
btopenitem: TSeSkinSpeedButton;
btsaveitem: TSeSkinSpeedButton;
btcutitem: TSeSkinSpeedButton;
btpasteitem: TSeSkinSpeedButton;
btcopyitem: TSeSkinSpeedButton;
SeSkinSpeedButton8: TSeSkinSpeedButton;
SeSkinSpeedButton9: TSeSkinSpeedButton;
SeSkinSpeedButton10: TSeSkinSpeedButton;
SeSkinSpeedButton11: TSeSkinSpeedButton;
SeSkinSpeedButton12: TSeSkinSpeedButton;
SeSkinSpeedButton13: TSeSkinSpeedButton;
ActionList1: TActionList;
EditCut1: TEditCut;
EditCopy1: TEditCopy;
EditPaste1: TEditPaste;
EditSelectAll1: TEditSelectAll;
EditUndo1: TEditUndo;
menuundoiten: TSeSkinItem;
SeSkinSpeedButton1: TSeSkinSpeedButton;
SeSkinPopupMenu1: TSeSkinPopupMenu;
popcopyitem: TSeSkinItem;
poppasteitem: TSeSkinItem;
popcutitem: TSeSkinItem;
popnewitem: TSeSkinItem;
poplookitem: TSeSkinItem;
popcompliitem: TSeSkinItem;
popruncurseitem: TSeSkinItem;
n3: TSeSkinItem;
CustomItem12: TSeSkinItem;
popsaveitem: TSeSkinItem;
popsetitem: TSeSkinItem;
CustomItem15: TSeSkinItem;
FileSaveAs1: TFileSaveAs;
SaveDialog1: TSaveDialog;
procedure FileNew1Execute(Sender: TObject);
procedure FileOpen1Execute(Sender: TObject);
procedure HelpAbout1Execute(Sender: TObject);
procedure FileExit1Execute(Sender: TObject);
procedure WindowCascade1Execute(Sender: TObject);
procedure WindowTileItem2Click(Sender: TObject);
procedure WindowCascadeItemClick(Sender: TObject);
procedure windowtileitemClick(Sender: TObject);
procedure btnewitemClick(Sender: TObject);
procedure FileSaveAs1Accept(Sender: TObject);
procedure btsaveitemClick(Sender: TObject);
private
{ Private declarations }
procedure CreateMDIChild(const Name: string);
public
{ Public declarations }
end;
var
MainForm: TMainForm;
implementation
{$R *.dfm}
uses CHILDWIN, about;
procedure TMainForm.CreateMDIChild(const Name: string);
var
Child: TMDIChild;
begin
{ create a new MDI child window }
Child := TMDIChild.Create(self);
Child.Caption := Name;
{Child.FlatMemo1.Height:=Child.Height-20;
Child.FlatMemo1.Width:=Child.Width -4;
}
if FileExists(Name) then
Child.RICHEDIT1.Lines.LoadFromFile(Name);
end;
procedure TMainForm.FileNew1Execute(Sender: TObject);
begin
CreateMDIChild('NONAME' + IntToStr(MDIChildCount + 1));
end;
procedure TMainForm.FileOpen1Execute(Sender: TObject);
begin
if OpenDialog.Execute then
CreateMDIChild(OpenDialog.FileName);
end;
procedure TMainForm.HelpAbout1Execute(Sender: TObject);
begin
AboutBox.ShowModal;
end;
procedure TMainForm.FileExit1Execute(Sender: TObject);
begin
Close;
end;
procedure TMainForm.WindowCascade1Execute(Sender: TObject);
begin
cascade;
end;
procedure TMainForm.WindowTileItem2Click(Sender: TObject);
begin
tilemode:=tbvertical;
tile;
end;
procedure TMainForm.WindowCascadeItemClick(Sender: TObject);
begin
cascade;
end;
procedure TMainForm.windowtileitemClick(Sender: TObject);
begin
tilemode:=tbhorizontal;
tile;
end;
procedure TMainForm.btnewitemClick(Sender: TObject);
begin
FileNew1Execute(sender);
end;
procedure TMainForm.FileSaveAs1Accept(Sender: TObject);
var
child:Tmdichild;
begin
child.RichEdit1.Lines .SaveToFile(filesaveas1.Dialog.FileName );
end;
procedure TMainForm.btsaveitemClick(Sender: TObject);
begin
inherited;
if savedialog1.Execute then
mdichild.RichEdit1.Lines.SaveToFile(savedialog1.FileName);
end;
end.
提示为:
project mdiapp.exe raised exception class EAccessViolation with message'Access
violation' at address 004a1513 in module 'mdiapp.exe'.read of address ffffffff
mdiapp.exe为文件编译后的名字.