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í)很有用,但在打開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)航:
           
          主站蜘蛛池模板: 鄯善县| 德昌县| 陵水| 扎赉特旗| 霍邱县| 育儿| 湖南省| 南郑县| 双辽市| 浦县| 永胜县| 都兰县| 博湖县| 成安县| 棋牌| 加查县| 南岸区| 金沙县| 鄄城县| 义马市| 太仓市| 延寿县| 海兴县| 大足县| 睢宁县| 平昌县| 宜春市| 和静县| 舒城县| 体育| 禹城市| 奎屯市| 辽源市| 寿光市| 旬阳县| 平陆县| 孝义市| 闸北区| 汤原县| 隆回县| 个旧市|