Solved

repeatable components?

Posted on 1998-04-19
2
163 Views
Last Modified: 2010-08-05
is there any repeatable compenents on there..
i 'd like to use a Tedit where on ocassion i can 'expand' the instance of a Tedit. Say i need Tedit1, Tedit2, Tedit3 but i don't want to show ("collapsed") tedit2/3 until i have a need to use them - due to screen-space constraints. Is there a mutant of Tedit like this out there?

thanks
0
Comment
Question by:eriklee
2 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1335199
I don't know about a component, but what about this? :

1. Use TMemo,

or

2. If needed a TEdit, create it on run-time and place it under Tedit1.

Regards, Zif.
0
 
LVL 1

Accepted Solution

by:
pjdb earned 40 total points
ID: 1335200
You can create components at runtime
In the private part of the form declaration put :
myEdit:array[2..3] Of TEdit;

in the OnCreate event of the form put (to make sure to free the variable if they have been allocated only) :
Var
  i:Byte;
Begin
  For i:=2 To 3 Do
    myEdit[i]:=Nil;
End;

in a procedure or function (the one that shoul show the Edit boxes) put :
Begin
  myedit[2]:=Tedit.Create(Form1);
  myedit[2].Parent:=form1.Handle;
  {after that, it have a default position and size and can be acessed in the same way as a "standard" Edit box}
End;

in the OnDestroy event of the form (to free the variables) :
Var
  i:Byte;
Begin
  For i:=2 To 3 Do
    If myEdit[i]<>nil Then
      Try
        myEdit.Free;
      Except
      End;  
End;

JDB
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now