About Component Focus |
尚未結案
|
marker
一般會員 ![]() ![]() 發表:9 回覆:5 積分:2 註冊:2004-11-05 發送簡訊給我 |
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 發送簡訊給我 |
1. TWinControl.GetTabOrderList
2. message WM_NEXTDLGCTL http://pywong.hk.st http://www.lazybones.ca
|
marker
一般會員 ![]() ![]() 發表:9 回覆:5 積分:2 註冊:2004-11-05 發送簡訊給我 |
|
Fishman
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:120 回覆:1949 積分:2163 註冊:2006-10-28 發送簡訊給我 |
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 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |