Solved

repeatable components?

Posted on 1998-04-19
2
162 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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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