?? 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); {動態(tài)創(chuàng)建控件}
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 {然后再動態(tài)創(chuàng)建組件}
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 + -