RecordViewDlg

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

          Info Power 是個很棒的VCL,特別是RecordViewDlg控件很有特點,在添加和編輯數(shù)據(jù)時很有用,但在打開EnterToTab參數(shù)時不能跳到確認鍵上,必須用鼠標(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;

          ......


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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 富平县| 桦南县| 资中县| 久治县| 绵阳市| 广宁县| 铜山县| 盐源县| 芮城县| 辽中县| 徐闻县| 修文县| 特克斯县| 天门市| 柞水县| 镇雄县| 丰宁| 华池县| 武乡县| 南涧| 平利县| 玛多县| 铜梁县| 哈尔滨市| 德州市| 社会| 陆河县| 永康市| 五大连池市| 土默特左旗| 神池县| 云梦县| 庄河市| 易门县| 宁武县| 中山市| 丁青县| 阿拉善左旗| 桃源县| 若尔盖县| 广河县|