Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 24-10-2018
TavoBran TavoBran is offline
Miembro
NULL
 
Registrado: oct 2018
Posts: 13
Poder: 0
TavoBran Va por buen camino
Amigo muchas gracias por su ayuda ya busque y pude solucionar mi error

les dejo mi solucion y me dicen que les parece

Código Delphi [-]

unit Ejecucion;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, Vcl.Menus;

type
  matriz = array of array of Integer;
  TfrmEjecucion = class(TForm)
    Button1: TButton;
    Edt: TEdit;
    Panel1: TPanel;
    Panel2: TPanel;
    Button2: TButton;
    Button3: TButton;
    MainMenu1: TMainMenu;
    Volver1: TMenuItem;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Volver1Click(Sender: TObject);
  private
    { Private declarations }
  public
    NEdits : Integer;
    Edits: TEdit;
    m : matriz;
    f,c : Integer;
    con : Integer;
  end;

var
  frmEjecucion: TfrmEjecucion;


implementation

{$R *.dfm}

procedure TfrmEjecucion.Button1Click(Sender: TObject);
var
  i,j : Integer;
begin
  if Trim(Edt.Text) = '' then
  begin
    ShowMessage('Debe escribir un número');
    Exit;
  end;
  //Desicion para que no sea tan grande la matriz
  if StrToInt(Edt.Text) >= 11 then
  begin
    ShowMessage('El valor tiene que ser igual o menor a 10');
    Edt.Clear;
  end
  else
  begin
    //Establece el valor de la matriz y de los TEdit
    c := StrToInt(Edt.Text);
    f := StrToInt(Edt.Text);
    SetLength(m, StrToInt(Edt.Text),StrToInt(Edt.Text));
    Button1.Visible := False;
    Edt.Visible := False;
  end;
  //Creo y posiciono los Edits
 for i := 1 to c do
  begin
    for j := 1 to f do
    begin
      Edits := TEdit.Create(Self);
      Edits.Name := 'Edit' + IntToStr(i) + IntToStr(j);
      Edits.Text := '';
      Edits.Top := 21 * (i + 1);
      Edits.Left := 21 * (j + 1);
      Edits.Width := 20;
      Edits.Height := 20;
      Edits.AutoSize := False;
      Edits.Enabled := False;
      Edits.Parent := Panel1;
      Button3.Visible := True;
    end;
  end;
end;


procedure TfrmEjecucion.Button2Click(Sender: TObject);
begin
  m := nil;
end;

procedure TfrmEjecucion.Button3Click(Sender: TObject);
var
  i,j,c : Integer;
  Comp : TComponent;
begin
  //Agrega numeros a la matriz aleatoriamente.
  c := StrToInt(Edt.Text);
  For i := 0 to c do
  begin
    for j := 0 to c do
    begin
       Comp := FindComponent ('Edit' + IntToStr(i)+ IntToStr(j));
       if Assigned (Comp) then
       begin
         (Comp as TEdit).Text := IntToStr(Random(100));
       end;
    end;
  end;

end;

procedure TfrmEjecucion.Volver1Click(Sender: TObject);
begin
    Close;
end;

end.
Responder Con Cita
 



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Asignar un evento a un componente creado en tiempo de ejecucion FGarcia OOP 7 12-09-2014 23:27:35
Evento en BitBtn creado en tiempo de ejecución newtron OOP 2 10-05-2012 16:54:14
eventos de PageControl creado en tiempo de ejecucion kaozz OOP 5 17-07-2007 15:02:10
Mostrar un texto creado en tiempo de ejecución FunBit Varios 1 10-10-2005 13:23:39
saber el nombre de un control creado en tiempo de ejecucion xxxlincexxx Varios 10 10-08-2003 23:45:54


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


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