Link to home
Start Free TrialLog in
Avatar of TPAKTOP
TPAKTOP

asked on

Text Boxes!

HI!

I am currently working on project where i have to create, requested by user number of EditBoxes! And after user enters values in those boxes and presess button, all these values from editboxes should be stored in array!
Any Ideas.
Thanx!
Avatar of Fatman121898
Fatman121898

Hi TPAKTOP,

Which is the problem: creating EditBox or storing it's content in array?
(Ru or Bg?)

Jo.
Avatar of TPAKTOP

ASKER

Actually i would like to get an answer for both. However storing contents is more important!
Thanx!
ASKER CERTIFIED SOLUTION
Avatar of DrDelphi
DrDelphi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey Doc,

You got me on the turn.
I should answer the same way.
;-)

Jo.
I guess it would be better to use a linked list, so can have a variable number of EditBoxes.

PNode=^TNode;
TNode=Record
  Edit:TEditBox;
  Next:PNode;
End;

(I used a Record, you can also use an Object or a Class)
There's no need to use a link list... just make the arrays openended..


Var EditArray :array of Tedit;

begin
  SetLength(EditArray,Length(EditArray)+1);
  EditArray[length(editArray)]:=Tedit.create(self);
  yada,
  yada,
  yada,
 (You get the idea....)


Place all created TEdit controls on a Panel or a GroupBox. Then you can loop throw Controls property of container and save TEdit values into your array or list.
By this method you have the number of created EditBoxes on ControlCount property and EditBoxes in Controls[0] to Controls[ControlCount-1].

I hope this helps