Assume that the following frame forms exist: fromframe, levelframe
1. If you need to generate them dynamically based on the class name, first register their respective classes in the PAS of each frame form.
As follows: Initialization
Registerclass (tfromframe );
Initialization
Registerclass (tlevelframe );
2. Reference them in the caller's pas
For example:Uses ufromframe, ulevelframe;
3. Obtain the class name
4. dynamically generate frame forms based on class names
Procedure Lp_showframe (framename: string );
Type
Tframeclass = Class Of Tframe;
VaR
Frameclass: tframeclass;
Fframe: tframe;
Begin
If Fframe <> Nil Then Fframe: = Nil ;
Frameclass: = Tframeclass (findclass ( ' T ' + Framename ));
Fframe: = Frameclass. Create (Self );
With Fframe Do Begin
Parent: = Tab_detail;
Visible: = True;
Top: = 40 ;
Font. Name: = ' ' ;
Font. Size: = 9 ;
End ;
End ;
5. Call method:Lp_showframe (framename );