Click(Sender: TObject);
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;