Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-10-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Algo como

Form := TForm(GetClass('TForm2'));

// Saludos
Responder Con Cita
  #2  
Antiguo 17-10-2005
RJF RJF is offline
Miembro
 
Registrado: abr 2005
Posts: 24
Poder: 0
RJF Va por buen camino
Unhappy

Gracias ROMAN aunque sigo con problemas, mira
Código Delphi [-]
var
i,j : Integer;
vFormu: TForm;
formu: Tformclass;
texto,cadena: string;
archivo,archivo2 : textfile;
begin
...
 
AssignFile(archivo,'listaForm.dat');
Reset(archivo);
while not Eof(archivo) do
begin
  Readln(archivo,texto);
  Formu := TFormClass(GetClass('form2')); //con 'Tform2' tampoco funciona
  Application.CreateForm(formu,vFormu);
  for j := 0 to vformu.ComponentCount -1 do
   if vformu.Components[j] is TButton then
   begin
    TButton(vformu.Components[j]).enabled := false;
    ShowMessage(TButton(vformu.Components[j]).Caption);
   end;
end;
CloseFile(archivo);
end;
Algo que vean mal ? Sugerencias ?

Editado:
Creo que estoy encerrado en mi problema, porque tengo que registrar la clase de Tform2 para que lo anterior funcione pero vuelvo a lo mismo solo tengo el nombre del formulario como string

Última edición por Casimiro Noteví fecha: 09-12-2021 a las 16:21:24.
Responder Con Cita
  #3  
Antiguo 09-12-2021
ASAPLTDA ASAPLTDA is offline
Miembro
 
Registrado: jun 2003
Ubicación: COLOMBIA-CALI
Posts: 639
Poder: 24
ASAPLTDA Va por buen camino
Crear forma por nombre

Código Delphi [-]
procedure CreateFormFromName( const FormName : string);
var 
  fc : TFormClass; 
  f  : TForm;
begin 
  fc := TFormClass(FindClass(FormName)); 
  f  := fc.Create(Application); f.Show;
end;

en la forma debe añadir:


initialization
RegisterClass(T Fnombre de la forma);
Responder Con Cita
  #4  
Antiguo 09-12-2021
ASAPLTDA ASAPLTDA is offline
Miembro
 
Registrado: jun 2003
Ubicación: COLOMBIA-CALI
Posts: 639
Poder: 24
ASAPLTDA Va por buen camino
crear forma por nombre firemonkey Solucion

https://stackoverflow.com/questions/...e-form-by-name

Código Delphi [-]
procedure TFMENU.CreateFormFromName(const FormName : string);
var
  ObjClass: TFmxObjectClass;
  NewForm: TCustomForm;
  w_ModalResult:Integer;
begin
 // ObjClass := TFmxObjectClass(GetClass(ClassName));
  ObjClass := TFmxObjectClass(GetClass(FormName));

  if ObjClass = nil then
    Exit;

  NewForm := ObjClass.Create(Self) as TCustomForm;
  if Assigned(NewForm) then
     begin
      NewForm.ShowModal(
      procedure(ModalResult: TModalResult)
      begin
        w_ModalResult:= ModalResult ;
 

      end);
     end;
end;


PD SOLUCION ENVIADA POR ULISES V EN WHATSAPP DELPHI EN ESPAÑOL
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 10:35:47.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi