1
I have created a Treeview with the data that is in a table in the BD, and has a field that contains the name in the form.
How To Give One ShowModal at the event OnClick of Treeview taking the name of the form that is in the table field?
Follows the code:
procedure CriaFormpeloNome(const FrmNome : string);
var
FrmClass : TFormClass;
Frm : TForm;
begin
try
FrmClass := TFormClass(FindClass(FrmNome));
Frm := FrmClass.Create(application);
except
//não achou a classe
showmessage('Não achou a classe');
end;
end;
procedure TFormFrontend.TreeView2DblClick(Sender: TObject);
var
Form2 : string;
begin
zmenu.SQL.Clear;
zmenu.SQL.Add('Select * from tab_menu');
zmenu.SQL.Add('WHERE id =:id');
zmenu.Params.ParamByName('id').value:= TreeView2.Selected.AbsoluteIndex;
zmenu.Open;
Form2:= zmenuarquivo.AsString;
Form2 := concat('T',Form2);
CriaFormpeloNome(Form2);
end;
Include your code, it’s easier for someone to help you ;)
– leofontes