RecordViewDlg

          Posted on 2006-09-20 10:46 小螞蟻 閱讀(174) 評(píng)論(0)  編輯  收藏 所屬分類: C++Builder 相關(guān)

          Info Power 是個(gè)很棒的VCL,特別是RecordViewDlg控件很有特點(diǎn),在添加和編輯數(shù)據(jù)時(shí)很有用,但在打開(kāi)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;

          ......


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 武威市| 莱西市| 凤凰县| 姚安县| 余干县| 兰西县| 惠水县| 金门县| 甘孜县| 长武县| 涿鹿县| 鄂托克前旗| 天门市| 贡觉县| 东台市| 成都市| 翁源县| 大竹县| 南漳县| 怀远县| 广德县| 紫阳县| 武冈市| 新昌县| 龙海市| 康马县| 利津县| 固原市| 五华县| 镇宁| 綦江县| 阳高县| 陇川县| 苏尼特右旗| 明溪县| 鄄城县| 宣武区| 宁海县| 武平县| 方城县| 峡江县|