procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
  KaoShi1Form: TKaoShi1Form;
implementation
 uses Kaishi,KaoShi2;
{$R *.DFM}
procedure TKaoShi1Form.Button1Click(Sender: TObject);
begin
if trim(Edit1.text)='' then
  begin
  showmessage('请输入姓名');
  Edit1.SetFocus;
  end
else
  begin
  if MessageDlg('真的要开始考试吗?',mtConfirmation, [mbYes, mbNo], 0)
      = mrYes then
    begin
    KaiShiform.renming:=Edit1.Text;
    Application.CreateForm(TKaoshi2Form, Kaoshi2Form);
    KaoShi2Form.Show;
    KaoShi1Form.Release;
    end
  end;
end;
procedure TKaoShi1Form.FormCreate(Sender: TObject);
var i:byte;
begin
query1.DatabaseName:=kaishiform.AppPath;
Query1.SQL.Add('Select zu from 题库.db group by zu');
Query1.open;
i:=1;
if query1.RecordCount>0 then
 begin
 while i<=query1.RecordCount do
  begin
  combobox1.Items.Add(Query1.fieldbyname('zu').asstring);
  i:=i+1;
  query1.RecNo:=i;
  end;
 combobox1.Text:=trim( combobox1.Items.Strings[0]);
 end;
end;
end.
得分界面与代码设计实现
unit Defen;
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;
type
  TDeFenForm = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    renming: TListBox;
    defen: TListBox;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  DeFenForm: TDeFenForm;
implementation
 uses kaishi;
{$R *.DFM}
procedure TDeFenForm.FormCreate(Sender: TObject);
begin
renming.Items.LoadFromFile(kaishiform.AppPath+'\rm.sav');
defen.Items.LoadFromFile(kaishiform.AppPath+'\df.sav');
end;
procedure TDeFenForm.Button1Click(Sender: TObject);
begin
renming.Items.Clear;
defen.Items.Clear;
renming.Items.SaveToFile(kaishiform.AppPath+'\rm.sav');
defen.Items.SaveToFile(kaishiform.AppPath+'\df.sav');
end;
end.
关于界面与代码设计实现
代码设计:
unit GuanYu;
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons;
type
  TGuanYuForm = class(TForm)
    Label1: TLabel;
    Label3: TLabel;
    Label2: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label8: TLabel;
    Label9: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  GuanYuForm: TGuanYuForm;
implementati
首页 上一页 1 2 3 4 5 6 下一页 尾页 3/6/6
delphi源代码+可执行文件+考试系统(三)由毕业论文网(www.huoyuandh.com)会员上传。

