7
I need to execute the following code, but the form in question is not always Uniform1. So I’m thinking of storing the name of form
into a variable and replace the Uniform1 for her sake.
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?
As per @Tmc’s reply, 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;
Please avoid long discussions in the comments; your talk was moved to the chat
– Maniero