Info Power 是个很棒的VCL,特别是RecordViewDlg控件很有特点,在添加和编辑数据时很有用,但在打开EnterToTab参数时不能跳到确认键上,必须用鼠标操作。还好有它的源码,稍微修改一下就可以了:
//--------------------
// 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;
......