procedure TForm1.BitBtn1Click(Sender: TObject);
var
i:Integer;
j:Integer;
SCaption:array[0..11] of string;
STable:array[0..11] of string;
language:string;
begin
try
i:=1;
if RadioButton1.Checked then
language:='Chinese'
else
language:='English';
ADOQuery1.First;
for j:=0 to ADOQuery1.RecordCount-1 do
begin
STable[j]:=ADOQuery1.FieldByName(language).asstring;
ADOQuery1.Next;
end;
ADOQuery1.First;
for i:=0 to GroupBox1.ControlCount-1 do
begin
(GroupBox1.Controls[i] as TCheckBox).Caption:=sTable[i];
with ADOQuery1 do
begin
Edit;
FieldByName('Enable').asboolean:= (GroupBox1.Controls[i] as TCheckBox).Checked;
Post;
Next;
end;
end;
except on e:Exception do
ShowMessage(e.Message);
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
var
k,i:Integer;
language:string;
begin
if RadioButton1.Checked then
language:='Chinese'
else
language:='English';
ADOQuery1.First;
for k:=0 to MainMenu1.Items.Count-1 do
begin
for i:=0 to MainMenu1.Items.Items[k].Count-1 do
begin
Memo1.Lines.Add(MainMenu1.Items.Items[k].Items[i].Caption);//測試用
if MainMenu1.Items.Items[k].Items[i].Caption<>'-' then
begin
MainMenu1.Items.Items[k].Items[i].Caption:=ADOQuery1.fieldByName(language).AsString;
ADOQuery1.Next;
end;
end;
end;
end;
英文的CheckBox:
中文的CheckBox
英文的Menu
中文的Menu
posted on 2006-08-19 14:13
才子£鸣 阅读(901)
评论(1) 编辑 收藏 引用