{*******************************************************}
{ }
{ Pascal Script Source File }
{ Run by RemObjects Pascal Script in CnWizards }
{ }
{ Generated by CnPack IDE Wizards }
{ }
{*******************************************************}
program ReNameDBControl;
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
CnWizUtils ,DBCtrls;
var
DesignContainer, Comp: TComponent;
I,CompCount: Integer;
begin
DesignContainer := IdeGetDesignedForm(nil);
if DesignContainer = nil then
begin
ErrorDlg('NO Designer Found.');
Exit;
end;
if DesignContainer.ComponentCount = 0 then
begin
ErrorDlg('NO Component to Process.');
Exit;
end;
for i := 0 to DesignContainer.ComponentCount - 1 do
begin
if DesignContainer.Components[i] is TDBEdit then
begin
Comp :=DesignContainer.Components[i];
SetPropValue(Comp, 'Name','dbedt'+Comp.DataField);
end;
end;
end.
{*******************************************************}
{ }
{ Pascal Script Source File }
{ Run by RemObjects Pascal Script in CnWizards }
{ }
{ Generated by CnPack IDE Wizards }
{ }
{*******************************************************}
program ReNameDBControl;
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
CnWizUtils ,TypInfo ,IdeInstComp;
var
DesignContainer, Comp: TComponent;
I,CompCount: Integer;
sDataField: string ;
begin
DesignContainer := IdeGetDesignedForm(nil);
if DesignContainer = nil then
begin
ErrorDlg('NO Designer Found.');
Exit;
end;
if DesignContainer.ComponentCount = 0 then
begin
ErrorDlg('NO Component to Process.');
Exit;
end;
for i := 0 to DesignContainer.ComponentCount - 1 do
begin
if DesignContainer.Components is TDBEdit then
begin
Comp :=DesignContainer.Components;
sDataField :=TDBEdit(DesignContainer.Components).DataField;
SetPropValue(Comp, 'Name','dbedt'+sDataField);
end;
end;
for i := 0 to DesignContainer.ComponentCount - 1 do
begin
if DesignContainer.Components[i] is TDBGridEh then
begin
Comp :=DesignContainer.Components[i];
for j := 0 to TDBGridEh(Comp).Columns.count - 1 do
begin
TDBGridEh(Comp).Columns[j].Title.Alignment :=taCenter;
TDBGridEh(Comp).Columns[j].Width :=100;
end;
end;
end;