unit FnBrResume;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DailogBase, cxControls, cxContainer, cxListBox, Menus,
cxLookAndFeelPainters, StdCtrls, cxButtons;type
TFnBrResumeForm = class(TDailogBaseForm)
cxListBox2: TcxListBox;
cxButton1: TcxButton;
cxButton2: TcxButton;
cxButton3: TcxButton;
cxButton4: TcxButton;
cxListBox1: TListBox;
function getzy: string;
procedure setzy(szy: string);
procedure FormActivate(Sender: TObject);
procedure cxButton4Click(Sender: TObject);
procedure cxButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
property zy: string read getzy write setzy;
end;var
FnBrResumeForm: TFnBrResumeForm;implementationuses FnEdResume, DataModule;{$R *.dfm}function TFnBrResumeForm.getzy: string;
begin
if cxListBox1.ItemIndex <> -1 then
Result := cxListBox1.Items[cxListBox1.ItemIndex] else
Result := '';
//得到摘要
end;
procedure TFnBrResumeForm.setzy(szy: string);
begin
zy := szy;
//设置摘要属性
end;
procedure TFnBrResumeForm.FormActivate(Sender: TObject);
begin
inherited;
with Application do
if FindComponent('FnEdResumeForm') = nil then
try CreateForm(TFnEdResumeForm, FnEdResumeForm); except end;
cxListBox1.Items.Clear;
with DModule.qFnSet do
begin
Close;
SQL.Clear;
SQL.Add('select * from tFnSet where lb=:lb');
parameters.ParambyName('lb').Value := '摘要';
Open;
while not Eof do
begin
cxListBox1.Items.Add(DModule.qFnSet['mc']);
Next;
end;
end;
end;procedure TFnBrResumeForm.cxButton4Click(Sender: TObject);
begin
inherited;
Close;
end;procedure TFnBrResumeForm.cxButton2Click(Sender: TObject);
begin
inherited;
FnEdResumeForm.show;
end;end.第二个窗体代码unit FnEdResume;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DailogBase, SnButton, ExtCtrls, StdCtrls, cxControls,
cxContainer, cxEdit, cxTextEdit;type
TFnEdResumeForm = class(TDailogBaseForm)
Panel1: TPanel;
bbOK: TSnButton;
bbCancel: TSnButton;
Label1: TLabel;
cxTextEdit1: TcxTextEdit;
procedure bbCancelClick(Sender: TObject);
procedure bbOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
FnEdResumeForm: TFnEdResumeForm;implementationuses DataModule, FnBrResume;{$R *.dfm}procedure TFnEdResumeForm.bbCancelClick(Sender: TObject);
begin
inherited;
Close;
end;procedure TFnEdResumeForm.bbOKClick(Sender: TObject);
var
i: Integer;
formopen: Boolean;
begin
inherited;
with DModule.qwork do
begin
SQL.Clear;
SQL.Add('insert into tFnSet(lb,mc)');
SQL.Add(' values(:lb,:mc)');
Prepared := True;
parameters.ParambyName('lb').Value := '摘要';
parameters.ParambyName('mc').Value := cxTextEdit1.text;
ExecSQL;
end;
formopen := False;
for i := 0 to screen.FormCount - 1 do
begin
if screen.Forms[i].ClassType = TFnBrResumeForm then formopen := True;
end; if formopen = True then
begin
with FnBrResumeForm do
begin
//cxlistbox1.Items.Clear;
with DModule.qFnSet do
begin
Close;
SQL.Clear;
SQL.Add('select * from tFnSet where lb=:lb');
parameters.ParambyName('lb').Value := '摘要';
Open;
while not Eof do
begin
//cxlistbox1.Items.Add(DModule.qFnSet['mc']);
Next;
end;
end;
end;
end;
cxTextEdit1.text := '';
cxTextEdit1.SetFocus;
end;end.执行到cxlistbox1.Items.Clear;和cxlistbox1.Items.Add(DModule.qFnSet['mc']);
这两句话就会出错,这是为什么。。
两个窗体BorderStyle:bsDailog
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DailogBase, cxControls, cxContainer, cxListBox, Menus,
cxLookAndFeelPainters, StdCtrls, cxButtons;type
TFnBrResumeForm = class(TDailogBaseForm)
cxListBox2: TcxListBox;
cxButton1: TcxButton;
cxButton2: TcxButton;
cxButton3: TcxButton;
cxButton4: TcxButton;
cxListBox1: TListBox;
function getzy: string;
procedure setzy(szy: string);
procedure FormActivate(Sender: TObject);
procedure cxButton4Click(Sender: TObject);
procedure cxButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
property zy: string read getzy write setzy;
end;var
FnBrResumeForm: TFnBrResumeForm;implementationuses FnEdResume, DataModule;{$R *.dfm}function TFnBrResumeForm.getzy: string;
begin
if cxListBox1.ItemIndex <> -1 then
Result := cxListBox1.Items[cxListBox1.ItemIndex] else
Result := '';
//得到摘要
end;
procedure TFnBrResumeForm.setzy(szy: string);
begin
zy := szy;
//设置摘要属性
end;
procedure TFnBrResumeForm.FormActivate(Sender: TObject);
begin
inherited;
with Application do
if FindComponent('FnEdResumeForm') = nil then
try CreateForm(TFnEdResumeForm, FnEdResumeForm); except end;
cxListBox1.Items.Clear;
with DModule.qFnSet do
begin
Close;
SQL.Clear;
SQL.Add('select * from tFnSet where lb=:lb');
parameters.ParambyName('lb').Value := '摘要';
Open;
while not Eof do
begin
cxListBox1.Items.Add(DModule.qFnSet['mc']);
Next;
end;
end;
end;procedure TFnBrResumeForm.cxButton4Click(Sender: TObject);
begin
inherited;
Close;
end;procedure TFnBrResumeForm.cxButton2Click(Sender: TObject);
begin
inherited;
FnEdResumeForm.show;
end;end.第二个窗体代码unit FnEdResume;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DailogBase, SnButton, ExtCtrls, StdCtrls, cxControls,
cxContainer, cxEdit, cxTextEdit;type
TFnEdResumeForm = class(TDailogBaseForm)
Panel1: TPanel;
bbOK: TSnButton;
bbCancel: TSnButton;
Label1: TLabel;
cxTextEdit1: TcxTextEdit;
procedure bbCancelClick(Sender: TObject);
procedure bbOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
FnEdResumeForm: TFnEdResumeForm;implementationuses DataModule, FnBrResume;{$R *.dfm}procedure TFnEdResumeForm.bbCancelClick(Sender: TObject);
begin
inherited;
Close;
end;procedure TFnEdResumeForm.bbOKClick(Sender: TObject);
var
i: Integer;
formopen: Boolean;
begin
inherited;
with DModule.qwork do
begin
SQL.Clear;
SQL.Add('insert into tFnSet(lb,mc)');
SQL.Add(' values(:lb,:mc)');
Prepared := True;
parameters.ParambyName('lb').Value := '摘要';
parameters.ParambyName('mc').Value := cxTextEdit1.text;
ExecSQL;
end;
formopen := False;
for i := 0 to screen.FormCount - 1 do
begin
if screen.Forms[i].ClassType = TFnBrResumeForm then formopen := True;
end; if formopen = True then
begin
with FnBrResumeForm do
begin
//cxlistbox1.Items.Clear;
with DModule.qFnSet do
begin
Close;
SQL.Clear;
SQL.Add('select * from tFnSet where lb=:lb');
parameters.ParambyName('lb').Value := '摘要';
Open;
while not Eof do
begin
//cxlistbox1.Items.Add(DModule.qFnSet['mc']);
Next;
end;
end;
end;
end;
cxTextEdit1.text := '';
cxTextEdit1.SetFocus;
end;end.执行到cxlistbox1.Items.Clear;和cxlistbox1.Items.Add(DModule.qFnSet['mc']);
这两句话就会出错,这是为什么。。
两个窗体BorderStyle:bsDailog
解决方案 »
- Idhttp的错误
- Undeclared identifier: 'IHtmlDocument2',使用IHtmlDocument2需要引用什么单元啊?
- 运行一代码提示缺少Txpmenu,求包含这个控件的三方控件全名
- 如何获得并改变屏幕刷新率?
- Outlook通讯薄的导出到自定义表的问题!!!
- 图片在程序页面如何充满?
- 类型转换,extended是什么类型阿?怎么转换成 integer 型?
- 我正在开发一个类似VAJ的java调试工具,功能差不多,调试功能可以与JBuilder相比
- SQL server如何利用字段存储图片
- 如何在前台应用程序里存入和显示出数据库的表中的图片?
- 请教!(急!急!急!急!)
- 以前有一本delphi的chm电子书,出了好几期,好像有11M 23M 之多,
FnBrResumeForm.cxlistbox1.add