unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
RadioGroup1: TRadioGroup;
RadioGroup2: TRadioGroup;
RadioGroup3: TRadioGroup;
Button2: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
count,n, a,b,c:integer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
index: integer;
begin
n:=1;
for Index:=0 to ControlCount-1 do
Begin
if Components[Index] is TRadiogroup then
begin
(Components[Index] As TRadiogroup).caption:='第'+inttostr(index)+'题';
end;
end;
end;
procedure TForm1.Button_nextClick(Sender: TObject);
var
index: integer;
begin
inc(n);
if n>9 then
begin
n:=9; //假设有30道题
exit;
end;
for Index:=0 to ControlCount-1 do
begin
if Components[Index] is TRadiogroup then
begin
(Components[Index] As TRadiogroup).caption:='第'+inttostr(index+3*n)+'题';
end;
end;
end;
procedure TForm1.Button_prevClick(Sender: TObject);
var
index: integer;
begin
dec(n);
if n<0 then
begin
N:=0;
exit;
end;
for Index:=0 to ControlCount-1 do
begin
if Components[Index] is TRadiogroup then
begin
(Components[Index] As TRadiogroup).caption:='第'+inttostr(index+3*n)+'题';
end;
end;
end;
end.
我这里没有题库,只能作到这里了。
[此贴子已经被作者于2006-4-10 16:26:25编辑过]