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