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

請問如果我動態產生物件??

尚未結案
shing.net
中階會員


發表:207
回覆:124
積分:66
註冊:2002-03-16

發送簡訊給我
#1 引用回覆 回覆 發表時間:2002-11-14 11:19:42 IP:211.74.xxx.xxx 未訂閱
請問如果我'動態'產生物件要將Enter鍵模擬Tab鍵功能亦即User按Enter到下一物件 因為我若在Design時就產生物件沒問題,但是動態產生物件有進入該事件(Form1.Keypress)但是卻沒有移到下一物件請問是何原因 動態產生物件之parent為動態產生之pageControl之TabSheet
william
版主


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2002-11-14 11:30:13 IP:147.8.xxx.xxx 未訂閱
Just out of curiosity, how do you simulate the 'Tab'?
shing.net
中階會員


發表:207
回覆:124
積分:66
註冊:2002-03-16

發送簡訊給我
#3 引用回覆 回覆 發表時間:2002-11-14 15:42:46 IP:211.74.xxx.xxx 未訂閱
程式如下: If key = #13 then begin key := #0; perform(WM_NEXTDLGCTL, 0, 0); end; 為何其移動不會按照Taborder順序 但若按Tab鍵會照順序移動請問其原因??
william
版主


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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2002-11-14 16:06:12 IP:147.8.xxx.xxx 未訂閱
I have created a simple test program using Delphi 7 and found no problem, i.e. can change focus to the next control. Could you please give more details on your application?
shing.net
中階會員


發表:207
回覆:124
積分:66
註冊:2002-03-16

發送簡訊給我
#5 引用回覆 回覆 發表時間:2002-11-14 17:02:38 IP:211.74.xxx.xxx 未訂閱
引言: I have created a simple test program using Delphi 7 and found no problem, i.e. can change focus to the next control. Could you please give more details on your application?
我的Form是直接讀*.dfm其為對應*.pas因為其dfm有其Taborder之屬性 合理應可執行才對,因為按Tab鍵可以,為何用 Enter不行
william
版主


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

發送簡訊給我
#6 引用回覆 回覆 發表時間:2002-11-14 17:11:37 IP:147.8.xxx.xxx 未訂閱
Here is my test program. I have tried changing TabOrder of Edit7 and Edit8 and found no problem  < class="code">unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; type TForm1 = class(TForm) PageControl1: TPageControl; TabSheet1: TTabSheet; TabSheet2: TTabSheet; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit; procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } Edit7: TEdit; Edit8: TEdit; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); begin if Key=#13 then begin key := #0; perform(WM_NEXTDLGCTL, 0, 0); end; end; procedure TForm1.FormCreate(Sender: TObject); begin Edit7:= TEdit.Create(self); Edit8:= TEdit.Create(self); with Edit7 do begin Parent := TabSheet2; Left := Edit4.Left; Top := Edit4.Top 20; OnKeyPress := Edit1KeyPress; end; with Edit8 do begin Parent := TabSheet2; Left := Edit4.Left; Top := Edit4.Top 40; OnKeyPress := Edit1KeyPress; end; end; procedure TForm1.FormDestroy(Sender: TObject); begin Edit7.Free; Edit8.Free; end; end.
系統時間:2024-04-30 16:11:56
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!