formula one6.1 在表格中怎么表示一些开关选择操作?很急(200分)

  • 主题发起人 主题发起人 longbow74
  • 开始时间 开始时间
L

longbow74

Unregistered / Unconfirmed
GUEST, unregistred user!
例如加个check控件
 
formula one有checkbox啊.
留个信箱,给你一个例程吧.
 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
AxCtrls, OleCtrls, TTF160_TLB, StdCtrls;

type
TInteresting = Record
ID : integer;
Name : string;
end;

TForm1 = class(TForm)
F1Book61: TF1Book6;
Label1: TLabel;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
Interesting : array[1..6] of TInteresting;
function GetInteresting : string;
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
var
id : integer;
begin
Interesting[1].Name := '围棋';
Interesting[2].Name := '足球';
Interesting[3].Name := '登山';
Interesting[4].Name := '音乐';
Interesting[5].Name := '泡妞';
Interesting[6].Name := '喝酒';

Interesting[1].ID := f1book61.ObjCreate(F1ObjCheckBox,0,1,1,2);
f1Book61.ObjText[Interesting[1].ID] := Interesting[1].Name;

Interesting[2].ID := f1book61.ObjCreate(F1ObjCheckBox,0,2,1,3);
f1Book61.ObjText[Interesting[2].ID] := Interesting[2].Name;

Interesting[3].ID := f1book61.ObjCreate(F1ObjCheckBox,0,3,1,4);
f1Book61.ObjText[Interesting[3].ID] := Interesting[3].Name;

Interesting[4].ID := f1book61.ObjCreate(F1ObjCheckBox,1,1,2,2);
f1Book61.ObjText[Interesting[4].ID] := Interesting[4].Name;

Interesting[5].ID := f1book61.ObjCreate(F1ObjCheckBox,1,2,2,3);
f1Book61.ObjText[Interesting[5].ID] := Interesting[5].Name;

Interesting[6].ID := f1book61.ObjCreate(F1ObjCheckBox,1,3,2,4);
f1Book61.ObjText[Interesting[6].ID] := Interesting[6].Name;
end;

function TForm1.GetInteresting: string;
var
str : string;
i : integer;
begin
result := '您的个人爱好为:' + #13+#10;
str := '';
for i := 1 to 6 do
if f1book61.ObjValue[Interesting.ID] = 1 then
str := str + Interesting.Name + ',';
if str <> '' then
str := Copy(str,1,length(str)-1)+'.';
result := result + str;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption := GetInteresting;
end;

end.
 
接受答案了.
 
后退
顶部