Info Power 是個(gè)很棒的VCL,特別是RecordViewDlg控件很有特點(diǎn),在添加和編輯數(shù)據(jù)時(shí)很有用,但在打開EnterToTab參數(shù)時(shí)不能跳到確認(rèn)鍵上,必須用鼠標(biāo)操作。還好有它的源碼,稍微修改一下就可以了:
//--------------------
//? wwrcdvw.pas
//--------------------
......
????? RecordPanel:= TPanel.create(RecordViewForm);
????? with RecordPanel do begin
???????? parent:= RecordViewForm;
???????? Left := 0;
???????? Top := 41;
???????? Align := alClient;
???????? BevelInner := bvLowered;
???????? BorderWidth := 4;
???????? Caption := '';
???????? TabOrder := 0;?? //I hack
???????? Name:= 'RecordPanel';
???????? visible:= True;
????? end;
????? if (rvokShowOKCancel in OKCancelOptions) then begin
???????? ButtonPanel:= TPanel.create(RecordViewForm);
???????? with ButtonPanel do begin
??????????? parent:= RecordViewForm;
??????????? Left := 0;
??????????? Top := 0;
??????????? Align := alBottom;
??????????? Name:= 'UserPanel';
??????????? Caption := '';
??????????? TabOrder := 1;? //I?hack
??????????? visible:= True;
??????????? OkBtn:= TButton(wwCreateCommonButton(RecordViewForm, bkOK));
??????????? OKBtn.Default:= not (rvoEnterToTab in Options);
??????????? OkBtn.parent:= ButtonPanel;
??????????? OKBtn.visible:= True;
??????????? OKBtn.OnClick := OKBtnClick;
??????????? OKBtn.TabStop:= True;? //I hack
??????????? CancelBtn:= TButton(wwCreateCommonButton(RecordViewForm, bkCancel));
??????????? CancelBtn.Parent := ButtonPanel;
??????????? CancelBtn.visible:= True;
??????????? CancelBtn.OnClick := CancelBtnClick;
??????????? CancelBtn.TabStop:= True; //I hack
??????????? CancelBtn.Cancel:= False; { Allows Escape to be processed }
??????????? bottomPad := 1 + GetSystemMetrics(SM_CYDLGFRAME)*2 +8 +1;? {Win95 fix }
??????????? Height := OkBtn.Top + OkBtn.height + BottomPad;
??????????? OkBtn.Top := GetSystemMetrics(SM_CYDLGFRAME) + 5;
??????????? CancelBtn.Top := GetSystemMetrics(SM_CYDLGFRAME) +5;
???????? end;
????? end;
......