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

About Component Focus

尚未結案
marker
一般會員


發表:9
回覆:5
積分:2
註冊:2004-11-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-01-06 15:53:23 IP:210.177.xxx.xxx 未訂閱
Hi all, I knew that there is focusing order between component in a form. 1. How can I get this focusing order list in runtime? 2. Besides getting the focus for a component using setFocus(), how can I pass the active focus to the next focusable component? Thanks for any reply. Mark Leung
william
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-06 16:41:02 IP:147.8.xxx.xxx 未訂閱
1. TWinControl.GetTabOrderList 2. message WM_NEXTDLGCTL    http://pywong.hk.st http://www.lazybones.ca
marker
一般會員


發表:9
回覆:5
積分:2
註冊:2004-11-05

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-01-10 17:03:33 IP:210.177.xxx.xxx 未訂閱
William, Can you make a simple example to show this? Thanks. Mark Leung
Fishman
尊榮會員


發表:120
回覆:1949
積分:2163
註冊:2006-10-28

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-01-11 09:01:41 IP:210.65.xxx.xxx 未訂閱
Hi marker,    Sorry to interrupt you. Please reference http://www.web-one.org/new-6551623-4938.html 1.
procedure TForm1.Button1Click(Sender: TObject);
var
  TOL : TList;
  I : Integer;
  Tmp : TWinControl;
begin
  TOL := TList.Create;
  Memo1.Lines.Clear;
  try
    Self.GetTabOrderList(TOL);
    for i := 0 to TOL.Count - 1 do
      begin
        Tmp := TOL.Items[i];
        Memo1.Lines.Add(Tmp.Name);
      end;
  finally
    TOL.Free;
  end;
end;
2.Set Form.KeyPreview to True and add below programs to From.OnKeyPress
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if key = #13 then
    begin
      self.Perform(WM_NEXTDLGCTL, 0, 0);
      Key := #0;
    end;
end;
---------------------------------- 小弟才疏學淺,若有謬誤尚請不吝指教 ----------------------------------
------
Fishman
系統時間:2024-07-04 21:53:11
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!