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

請問如何能夠按tab order次序得到focus?

尚未結案
donlly
一般會員


發表:45
回覆:73
積分:23
註冊:2004-11-30

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-01-03 16:14:22 IP:219.235.xxx.xxx 未訂閱
有3個edit元件edit1,edit2,edit3,它們的tab order是1,2,3,請問怎樣 做到當用戶在某個edit按下"enter"key的時候,按下一個tab order次序的edit 得到focus? 例如:當用戶在edit1填寫完資料后,按下"enter"key,這時候edit2得到focus,當用戶在edit2填寫完資料后,按下"enter"key,這時候edit3得到focus...
Fishman
尊榮會員


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-03 16:30:54 IP:210.65.xxx.xxx 未訂閱
Hi donlly,    請參考    http://delphi.ktop.com.tw/topic.php?topic_id=42400 http://delphi.ktop.com.tw/topic.php?topic_id=48675 http://delphi.ktop.com.tw/topic.php?topic_id=57783 http://delphi.ktop.com.tw/topic.php?topic_id=58334 1.set form.KeyPreview to True 2.Form.OnKeyPress Event
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then Perform(WM_NEXTDLGCTL,0,0);
end;
發表人 -
------
Fishman
donlly
一般會員


發表:45
回覆:73
積分:23
註冊:2004-11-30

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-01-03 17:12:34 IP:219.235.xxx.xxx 未訂閱
謝謝,請問一下Perform(WM_NEXTDLGCTL, 0, 0);是什么意思?
Fishman
尊榮會員


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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2005-01-03 17:37:09 IP:210.65.xxx.xxx 未訂閱
Hi donlly,    Perform : Responds as if the control received a specified Windows message.     Delphi syntax: function Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;    Call Perform to bypass the Windows message queue and send a message directly to the control? window procedure.    Perform fills a message record (of type TMessage) with the message ID passed in the Msg parameter, the message parameters passed in WParam and LParam, and a result field of zero. Perform then passes the message record to the WindowProc method for processing.    Come from D7 Help ---------------------------------- 小弟才疏學淺,若有謬誤尚請不吝指教 ----------------------------------
------
Fishman
P.D.
版主


發表:603
回覆:4038
積分:3874
註冊:2006-10-31

發送簡訊給我
#5 引用回覆 回覆 發表時間:2005-01-03 18:08:20 IP:61.71.xxx.xxx 未訂閱
引言: 有3個edit元件edit1,edit2,edit3,它們的tab order是1,2,3,請問怎樣 做到當用戶在某個edit按下"enter"key的時候,按下一個tab order次序的edit 得到focus? 例如:當用戶在edit1填寫完資料后,按下"enter"key,這時候edit2得到focus,當用戶在edit2填寫完資料后,按下"enter"key,這時候edit3得到focus...
下載 dosmove 吧! 站上討論不下百封了!
arvin
一般會員


發表:12
回覆:9
積分:4
註冊:2002-09-11

發送簡訊給我
#6 引用回覆 回覆 發表時間:2005-01-04 11:03:17 IP:140.92.xxx.xxx 未訂閱
if Key = #13 then begin Perform(WM_NEXTDLGCTL,0,0); if ActiveControl Is TButton then Caption := '2'; while ActiveControl is TButton do begin Perform(WM_NEXTDLGCTL,0,0); end; end;
donlly
一般會員


發表:45
回覆:73
積分:23
註冊:2004-11-30

發送簡訊給我
#7 引用回覆 回覆 發表時間:2005-01-04 20:47:15 IP:219.235.xxx.xxx 未訂閱
明白!謝謝各位!
系統時間:2024-07-04 4:46:29
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!