Ver Mensaje Individual
  #1  
Antiguo 24-02-2019
Avatar de bulc
bulc bulc is offline
Miembro
 
Registrado: jun 2010
Posts: 415
Reputación: 14
bulc Va por buen camino
Acceder a componentes creados en ejecución

Tengo un Form creado en ejecución con varios componentes, entre ellos un TComboBox, unTEdit y un TButton. Quiero que el botón seleccione un elemento del Combo y lo pase al TEdit.
Si puedo acceder al botón, pero no consigo acceder al dato del Combo y pasarlo al TEdit.
Código Delphi [-]
// Código del Botón Btn_TEMA:
procedure TForm1.Btn_TemaClick( Sender: TObject);
begin
    With Sender as TButton do   // Como pasa el Edt_Tema ?
    begin
     Caption := 'Primer Item';
     // ?????????????????
    end;
end;


procedure TForm1.Button1Click(Sender: TObject);
Var
  FModal: TForm;
  EditA, Edt_Tema : TEdit;
  Boton, Btn_Tema: TButton;
  CBox : TComboBox;
  UD : TUpDown;
  Lbl : TLabel;
  Val : Integer;
begin
TRY
   ..............................
   With Btn_Tema do
  begin
    Caption:= 'Pasar Tema';
    Font.Size:= 11;
    Width:= 170;  // Prior to Left !!
    Height:= 40;
    Left:=Trunc( (FModal.Width - Boton.Width) div 2 ) + 130 ; // 95;
    Top:= 90;
    Parent:= FModal;
    onClick := Form1.Btn_TemaClick;  // Lo que hace el Butón Btn_TEMA
    Default:=True; //Btn that receives Event.
   end;
 
FINALLY
     fModal.Free;
 
END;
end;
end.
Saludos.
bulc
Responder Con Cita