Intraweb XI发布成EXE程序时实现自定义窗体的方法

intraweb11.0.63发布成EXE程序时实现

自定义窗体的方法

之所以写这篇文章,是因为我用file->new->other->intrabweb->intraweb application wizard开始新建的intraweb程序,保存后发现想改变程序的图标是不可以的,我用IW是IntraWeb 11.0.63,是在delphi7下使用的,不知道是不是因为我使用的破解版IW的原故还是其他的,在project->options->application的Ico处竟然是无效的,我不喜欢用delphi默认的应用程序图标,想换成自己喜欢的。在编译9.0版本的程序时,发现IntraWeb XI版本自动生成的dpr文件也是跟原来的在9.0以下的是不一样的,程序启动的方式改变了很多。

篇一

(一)带自已的定义的主窗体。

1、新建正常的app,具体步骤是:file->new->other->intrabweb->intraweb application wizard开始新建。直接保存

2、新加入一个from,具体步骤是:file->new->form开始新建,直接保存为unit2/ Form2。

3、修改生成的dpr文件,在dpr文件中是这样的写,红色的是需要改动的 program newform; uses Forms,

//IWStart,//被注销引用 IWMain,//新增引用

1

ServerController TIWServerController},

in 'ServerController.pas' {IWServerController:

Unit1 in 'Unit1.pas' {IWForm1: TIWFormModuleBase}, UserSessionUnit in 'UserSessionUnit.pas' {IWUserSession:

TIWUserSessionBase},

Unit2 in 'Unit2.pas' {Form2};

{$R *.res} begin

//TIWStart.Execute(True);//被注销不用的,此处只有这一句语句。 //以下是新增的,因为新增form2,所以form2为主页。共三个语句。 Application.Initialize;

Application.CreateForm(TForm2, Form2);//这句是关键。 Application.Run; end.

4、在from2中放置一个IWStandAloneServer1: TIWStandAloneServer,一个mmo1: TMemo,一个lbl1: TLabel.

分别写如下的代码:

procedure TForm2.FormCreate(Sender: TObject); begin

mmo1.Lines.Add('留言服务开关:On');

2

mmo1.Lines.Add('监听端口: ' + IntToStr(GServerController.Port)); mmo1.lines.add(''); end;

//此处GServerController.Port要引用IWglobal单元,所以要引用IWglobal,具体写法是在{$R *.dfm}下面写如下:uses IWglobal;

procedure TForm2.lbl1Click(Sender: TObject); begin

IWStandAloneServer1.Run; end;

procedure TForm2.IWStandAloneServer1DebugLog(ASender: TObject; ALog: String); begin

mmo1.Lines.Add(ALog); end;

5、在IWForm1中使用IW的控件进行应用的编写。 6、编译成功,运行成功,可以修改程序的图标。 见图:

3

篇二

(二)Intraweb默认的应用程序,可修改程序图标。

1、使用file->new->other->intrabweb->intraweb application wizard开始新建的Intraweb程序,直接保存。

2、修改生成的dpr文件,在dpr文件中是这样的写,红色的是需要改动的 program newform1; uses Forms, //IWStart,

IWMain,//新增引用 ServerController TIWServerController},

Unit1 in 'Unit1.pas' {IWForm1: TIWFormModuleBase}, UserSessionUnit TIWUserSessionBase};

{$R *.res}

4

in 'ServerController.pas' {IWServerController:

in 'UserSessionUnit.pas' {IWUserSession:

begin

// TIWStart.Execute(True); Application.Initialize;

Application.CreateForm(TformIWMain, formIWMain); Application.Run;

//注意:Application.CreateForm(TformIWMain, formIWMain);这一句,全部的程序都是要用CreateForm (TformIWMain, formIWMain),换成TIWForm1, IWForm1)出错。可能TformIWMain, formIWMain是系统默认启动的窗体。

end.

3、在IWForm1中使用IW的控件进行应用的编写。 4、编译成功,运行成功,可以修改程序的图标。 见图:

5

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4