Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm able to create TABSHEETS at run time using the solution given here TAB AT RUN TIME . In my use case I need to create an dynamic number of forms, I create 3 different subforms on that page control.

How to Create a dynamic set of forms and how to address these controls at run time ?

MyForm1 := CreateTabAndForm_type_1;
MyForm2 := CreateTabAndForm_type_1;
MyForm3 := CreateTabAndForm_type_1;
....
???
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
261 views
Welcome To Ask or Share your Answers For Others

1 Answer

Create a record containing a tabsheet and a form:

type 
  TTabsheetAndForm = record
    Tabsheet: TTabsheet;
    Form: TMyForm;
  end;

Then use either a dynamic array: TArray<TTabsheetAndForm> or array of TTabsheetAndForm. Or a generic container: TList<TTabsheetAndForm>.

Then populate the array or list as you instantiate your GUI controls.

If there are always exactly three of these things as you hint, then perhaps you don't even need the array. Three variables will do the job.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...