I need to run the following code, but the form in question is not always UniForm1 . So I'm thinking of storing the name of form
in a variable and replacing UniForm1 with it.
Instead of using:
UniForm1.Parent := UniPanel1;
UniForm1.Show;
UniForm1.SetFocus;
UniForm1.Width := UniPanel1.Width;
UniForm1.Height := UniPanel1.Height;
I need something like:
VariavelForm.Parent := UniPanel1;
VariavelForm.Show;
VariavelForm.SetFocus;
VariavelForm.Width := UniPanel1.Width;
VariavelForm.Height := UniPanel1.Height;
How to do this?
According to @Tmc's response, I made some changes.
But the error occurs:
[dcc32 Error] Main.pas (74): E2010 Incompatible types: 'TUniForm' and 'string'
procedure TMainForm.UniTreeView1Change(Sender: TObject; Node: TUniTreeNode);
var nome : string;
begin
nome := Node.Text;
Vforms := nome;
Vforms.Parent := UniPanel1;
Vforms.Show;
Vforms.SetFocus;
Vforms.Width := UniPanel1.Width;
Vforms.Height := UniPanel1.Height;
end;