📄 frame_dbcomponent.pas
字号:
unit frame_DBComponent;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ToolWin, ComCtrls, Grids, DBGridEh, PDBGridEh,
ExtCtrls, ImgList, StdCtrls;
type
TDBComponent = class(TPanel)
public
ID:String; // ID
field: string;
value: string;
edtType: string;
oper: string;
end;
TDBComponentFactory = class(TObject)
function genDBComponent(owner:TComponent;edtType, caption, ID, feild, oper: String;width:Integer):TDBComponent;virtual;
end;
implementation
{ TDBComponent }
{ TDBComponent }
{ TDBComponentFactory }
function TDBComponentFactory.genDBComponent(owner: TComponent; edtType,
caption, ID, feild, oper: String; width: Integer): TDBComponent;
var
lbl:TLabel;
edt:TEdit;
begin
Result:=TDBComponent.Create(owner);
lbl:=TLabel.Create(Owner);
lbl.Caption:=caption;
lbl.AutoSize:=true;
lbl.Parent:=Result;
lbl.Left:=8;
lbl.Top:=30-lbl.Height;
edt:=TEdit.Create(Owner);
edt.Parent:=Result;
edt.Width:=Width*7;
edt.Left:=lbl.Left+lbl.Width;
edt.Height:=30-edt.Width;
edt.Name:=id;
result.Width:=edt.Left+edt.Width+8;
result.Height:=30+8;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -