satish Guest
|
Posted: Wed Jan 03, 2007 8:57 pm Post subject: How to Get Dynamically created obejct name |
|
|
hi,
I created two comboboxes dynamically,
procedure TForm1.FormCreate(Sender: TObject);
begin
CreateComponents('Name',50,190);
CreateComponents('Discount',80,190);
CreateComponents('Rebate',110,190);
AddItems('Yes','No');
end;
Procedure Tform1.CreateComponents(inName : String ;
inXLoc, inYLoc : Integer);
var tmpLabel : TLabel;
tmpCmb : TComboBox;
begin
//Creating Label
tmpLabel := TLabel.Create(Self);
tmpLabel.Top := inXLoc;
tmpLabel.Left := inYLoc;
tmpLabel.Caption := trim(inName);
tmpLabel.Name := Trim('lbl'+inName);
tmpLabel.Parent := Self;
//Creating ComboBox
tmpCmb := TComboBox.Create(Self);
tmpCmb.top := inXLoc;
tmpCmb.Left := inYLoc+60;
tmpCmb.Name := Trim('cmb'+inName);
tmpCmb.Parent := Self;
tmpCmb.OnSelect := tmpcmbboxselect;
end;
how can i get the combonames in order to insert the comboboxes data
into the Table
thanking you in advance
sanjay |
|