📄 sqlcontent.pas
字号:
unit SQLContent;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TSQLContentFrm = class(TForm)
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
SQLContent_Row: integer;
end;
var
SQLContentFrm: TSQLContentFrm;
TmpLabel: array of TLabel;
TmpEdit: array of TEdit;
implementation
uses MainUnit;
{$R *.dfm}
procedure TSQLContentFrm.FormShow(Sender: TObject); {动态创建控件}
var
i: integer;
begin
SetLength(TmpLabel, MainForm.StringGrid1.ColCount - 1);
SetLength(TmpEdit, MainForm.StringGrid1.ColCount - 1);
for I := SQLContentFrm.ComponentCount - 1 downto 0 do {先释放所有组件}
SQLContentFrm.Components[I].Free;
for i := 0 to MainForm.StringGrid1.ColCount - 2 do {然后再动态创建组件}
begin
TmpLabel[i] := TLabel.Create(self);
TmpLabel[i].Parent := SQLContentFrm;
TmpLabel[i].Caption := MainForm.StringGrid1.Cols[i + 1].Text;
TmpLabel[i].Width := 60;
TmpLabel[i].Height := 15;
TmpLabel[i].Left := 20;
TmpLabel[i].Top := 10 * i + 12 + (i * 15);
TmpEdit[i] := TEdit.Create(self);
TmpEdit[i].Parent := SQLContentFrm;
TmpEdit[i].Text := MainForm.StringGrid1.Cells[i + 1,SQLContent_Row];
TmpEdit[i].Ctl3D := False;
TmpEdit[i].Width := 180;
TmpEdit[i].Height := 20;
TmpEdit[i].Left := 80;
TmpEdit[i].Top := 10 * i + 10 + (i * 15);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -