Ver Mensaje Individual
  #5  
Antiguo 15-05-2014
wilcg wilcg is offline
Miembro
 
Registrado: abr 2014
Posts: 107
Reputación: 11
wilcg Va por buen camino
Tienes razón ecfisa, creo que el problema viene por como creo el TEdit, porque he hecho pruebas tal como tu código y funciona perfecto.

La forma como creo los TEdit es desde un archivo XML previamente guardado todos la información de cada TEdit.
aquí el código

Código Delphi [-]
var
  XML : TXMLDocument;
  NComponente : IXMLNode;
  l: Integer;
  Edit: TEdit;
begin
   XML := TXMLDocument.Create(Application);
   try
      XML.Active := True;

      XML.LoadFromFile(ExtractFilePath(Application.ExeName) + '\Plantillas\00001.xml');

      for l := 0 to XML.DocumentElement.ChildNodes.Count - 1 do
      begin

        // ¿Es una Edit?
        if XML.DocumentElement.ChildNodes[l].NodeName = 'Edit' then
        begin
          NComponente := XML.DocumentElement.ChildNodes[l];
          Edit := TEdit.Create(Scroll1);
          Edit.Parent := Scroll1;
          Edit.Name := NComponente.Attributes['Nombre'];
          Edit.Tag := NComponente.Attributes['ID'];
          Edit.Left := NComponente.Attributes['x'];
          Edit.Top := NComponente.Attributes['y'];
          Edit.Width := NComponente.Attributes['Ancho'];
          Edit.Height := NComponente.Attributes['Alto'];
          Edit.Font.Color := NComponente.Attributes['Color'];
          if NComponente.Attributes['Tipo'] = '*' then
          begin
            Edit.PasswordChar := '*';
            Edit.PopupMenu:= PopupMenu1;
          end;
        end;

      XML.Active := False;
   finally
      XML := nil;
   end;
   end;


esta es la forma como se crean los edit, creo que ahí esta el error.
Responder Con Cita