線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1304
推到 Plurk!
推到 Facebook!

MDI

答題得分者是:ccchen
is_tem
一般會員


發表:17
回覆:15
積分:11
註冊:2002-04-17

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-09-28 03:30:04 IP:218.252.xxx.xxx 未訂閱
In a MDI development, there are forms, each form contain a DBGrid linked to a data module. I would like adding icon FIRST, PREVIOUS, NEXT, LAST, INSERT, DELETE in the tool bar of the main form. How can we program this? For example, Child form A show table A record is BOF; Child form B show table A record is EOF, etc. I would also want to place a CLOSE icon in the tool bar for closing the current active form? How can it achieve?
ccchen
版主


發表:61
回覆:940
積分:1394
註冊:2002-04-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-09-28 12:08:02 IP:203.217.xxx.xxx 未訂閱
procedure TMdiMainForm.ToolButton1Click(Sender: TObject);
var dsinfo: PPropinfo;
  ctrl:TControl;
  ds:TDataSet;
begin
  if ActiveMDIChild <> nil then  //ActiveMDIChild為目前Active 之child
    if ActiveMDIChild.ActiveControl<>nil then begin
      ctrl:=ActiveMDIChild.ActiveControl; //按toolButton前之active Control
      dsinfo := GetPropinfo(ctrl, 'DataSource');//取得該control是否有datasoure property
      if dsinfo<>nil  then begin  
        ds := TDataSource(GetOrdProp(ctrl,dsinfo)).DataSet; //取得Dataset
        showmessage(ds.name);
      end;
    end;
end;
上面程式Demo如何取得目前ActiveControl所對應到之DataSet, 我想之後的工作(FIRST, PREVIOUS, NEXT, LAST, INSERT, DELETE)針對此DataSet你應該沒問題了吧 close之toolButton直接
  if ActiveMDIChild <> nil then
    ActiveMDIChild.close;
須注意, mdiChild之close只是minimize,真的要close可在每一mdiChild之onClose加上 Action:=caFree;
is_tem
一般會員


發表:17
回覆:15
積分:11
註冊:2002-04-17

發送簡訊給我
#3 引用回覆 回覆 發表時間:2002-09-28 15:12:53 IP:218.252.xxx.xxx 未訂閱
高手........個然是高手。 One more question wish you can help. How to rotate a image? For example: A picture taken by a DC is 640 x 480, how to rotate and display it in 480x640?
is_tem
一般會員


發表:17
回覆:15
積分:11
註冊:2002-04-17

發送簡訊給我
#4 引用回覆 回覆 發表時間:2002-09-28 15:39:44 IP:218.252.xxx.xxx 未訂閱
Very Strange, There is no TypeInfo.pas in Delphi. TypeInfo
ccchen
版主


發表:61
回覆:940
積分:1394
註冊:2002-04-15

發送簡訊給我
#5 引用回覆 回覆 發表時間:2002-09-28 16:27:39 IP:203.217.xxx.xxx 未訂閱
不是typeinfo是TypInfo, 沒有e
delphiwww
資深會員


發表:145
回覆:363
積分:368
註冊:2002-03-13

發送簡訊給我
#6 引用回覆 回覆 發表時間:2002-09-30 08:55:17 IP:202.145.xxx.xxx 未訂閱
你可以直接使用ActionList,然後將DataSet中所有Action叫出, 然後在相對應的Button選取Action就可以    
引言: In a MDI development, there are forms, each form contain a DBGrid linked to a data module. I would like adding icon FIRST, PREVIOUS, NEXT, LAST, INSERT, DELETE in the tool bar of the main form. How can we program this? For example, Child form A show table A record is BOF; Child form B show table A record is EOF, etc. I would also want to place a CLOSE icon in the tool bar for closing the current active form? How can it achieve?
系統時間:2024-04-18 18:13:39
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!