Einzelnen Beitrag anzeigen

Delphi.Narium

Registriert seit: 27. Nov 2017
2.415 Beiträge
 
Delphi 7 Professional
 
#2

AW: TTreeView und Formularnamen als String

  Alt 14. Feb 2021, 14:10
Du weißt also, wie das Formular heißt, dann kannst Du es über den Namen suchen:

Mal als Idee hingedaddelt:
Delphi-Quellcode:
procedure ShowForm(NameDesFormulars : String);
var
  f : TWinControl;
begin
  f := FindControl(NameDesFormulars);
  if Assigned(f) then if f is TForm then TForm(f).Show;
end;

...
  qry.sql.Text := 'select Formularname from Tabelle where Spalte = ' + WertAusDemTreeView;
  qry.Open;
  ShowForm(qry.FieldByName('Formularname').AsString;
  qry.Close;
...
  Mit Zitat antworten Zitat