全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1491
推到 Plurk!
推到 Facebook!

請問在TActionList

尚未結案
aamihcom
一般會員


發表:57
回覆:40
積分:19
註冊:2003-10-02

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-12-02 13:48:26 IP:210.202.xxx.xxx 未訂閱
請問在TActionList內比如我新增了一項datasetInsert ActionList會自動幫我做插入的動入,但若是我又在這個button裡寫了程式碼 比如說修改時不讓人更改主鍵值,但這個button只要有程式碼ActionList裡的動作就不做了,請問有什麼辨法可讓我加入之程式式有做,而actionlist的動作也有做嗎
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-12-02 14:01:40 IP:147.8.xxx.xxx 未訂閱
This is extracted from the VCL source:    
procedure TControl.Click;
begin
  { Call OnClick if assigned and not equal to associated action's OnExecute.
    If associated action's OnExecute assigned then call it, otherwise, call
    OnClick. }
  if Assigned(FOnClick) and (Action <> nil) and (@FOnClick <> @Action.OnExecute) then
    FOnClick(Self)
  else if not (csDesigning in ComponentState) and (ActionLink <> nil) then
    ActionLink.Execute(Self)
  else if Assigned(FOnClick) then
    FOnClick(Self);
end;
It should execute the button onclick as designed. Either you modify the VCL (not recommend) or call your action execute in your button click.
image64
一般會員


發表:0
回覆:1
積分:0
註冊:2004-04-21

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-09-12 23:21:32 IP:218.162.xxx.xxx 未訂閱
在 Button 的 onClick 中 void __fastcall TForm1::Button2Click(TObject *Sender) { //程式其他動作 ... ((TButton *)Sender)->Action->Execute(); 即可執行所設定之ACTION動作 } ((TButton *)Sender)->Action->Execute() 與 Button1->Action->Execute()相同,用前者可不必每次修改元件名稱。只要Button 有設定ACTION即可。
系統時間:2024-06-30 18:32:27
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!