程序解式 |
尚未結案
|
friendly
一般會員 發表:7 回覆:3 積分:2 註冊:2004-10-17 發送簡訊給我 |
有些程序我不明白
可以給我解釋一下以及有什作用 const visiblebuttonarray:array[0..9] of tbuttonset=([nbfirst],
[nbprior],
[nbnext],
[nblast],
[nbinsert],
[nbDelete],
[nbedit],
[nbpost],
[nbcancel],
[nbrefresh]); var
Form2: TForm2;
Procedure DisableBtn();
Procedure BtnDeox();
implementation {$R *.DFM} procedure disablebtn();
begin
form2.bitbtn1.enabled:=false;
form2.bitbtn2.enabled:=false;
form2.bitbtn3.enabled:=false;
form2.bitbtn4.enabled:=false;
form2.bitbtn5.enabled:=false;
form2.bitbtn6.enabled:=false;
form2.bitbtn7.enabled:=false;
form2.bitbtn8.enabled:=false;
form2.bitbtn9.enabled:=false;
end; procedure btndeox();
begin
form2.bitbtn1.enabled:=false;
form2.bitbtn2.enabled:=false;
form2.bitbtn3.enabled:=true;
form2.bitbtn4.enabled:=true;
form2.bitbtn5.enabled:=false;
form2.bitbtn6.enabled:=false;
form2.bitbtn7.enabled:=false;
form2.bitbtn8.enabled:=false;
form2.bitbtn9.enabled:=false;
end; procedure TForm2.CheckBox1Click(Sender: TObject); //First
begin
with sender as Tcheckbox do
begin //Tag has no predefined meaning
checkbox1.tag:=0;
if checked then
DBNavigator.visiblebuttons:=DBNavigator.visiblebuttons
visiblebuttonarray[tag]
else
DBNavigator.visiblebuttons:=DBNavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox2Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox2.tag:=1;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox3Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox3.tag:=2;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox4Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox4.tag:=3;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox5Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox5.tag:=4;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox6Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox6.tag:=5;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox7Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox7.tag:=6;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox8Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox8.tag:=7;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox9Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox9.tag:=8;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end; procedure TForm2.CheckBox10Click(Sender: TObject);
begin
with sender as Tcheckbox do
begin
checkbox10.tag:=9;
if checked then
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons
visiblebuttonarray[tag]
else
dbnavigator.visiblebuttons:=dbnavigator.visiblebuttons -
visiblebuttonarray[tag];
end;
end;
|
hagar
版主 發表:143 回覆:4056 積分:4445 註冊:2002-04-14 發送簡訊給我 |
同學您是哪幾行不明白?
是有關 Set 型態的問題嗎?那可參考: http://delphi.ktop.com.tw/topic.php?topic_id=52123 還有以後貼程式碼的時候, 請記得用 "插入 code" 這個按鈕
詳細參考: http://delphi.ktop.com.tw/topic.php?TOPIC_ID=7326 --
Well be all right. If you dont like uphill battles, you dont like living.
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |