Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #11  
Antiguo 25-10-2018
TavoBran TavoBran is offline
Miembro
NULL
 
Registrado: oct 2018
Posts: 13
Poder: 0
TavoBran Va por buen camino
Post

roman si eso yo lo defino como me dices solo que tengo otra duda

este es mi codigo

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
  TMatriz = array of array of TEdit;
  TfrmEjecucion = class(TForm)
    Button1: TButton;
    Edt: TEdit;
    Panel1: TPanel;
    Panel2: TPanel;
    Button2: TButton;
    Button3: TButton;
    MainMenu1: TMainMenu;
    Volver1: TMenuItem;
    Button4: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmEjecucion: TfrmEjecucion;
  m : TMatriz;
  ma : Integer;

implementation

{$R *.dfm}

procedure CrearEdits(Edits:TMatriz);
var
  i,j :integer;
begin
  for i := 1 to ma do
  begin
    for j := 1 to ma do
    begin
      Edits[i,j]:=TEdit.Create(Self);
      Edits[i,j].Text := '';
      Edits[i,j].Top := 21 * (i + 1);
      Edits[i,j].Left := 21 * (j + 1);
      Edits[i,j].Width := 20;
      Edits[i,j].Height := 20;
      Edits[i,j].AutoSize := False;
      Edits[i,j].Enabled := False;
      Edits[i,j].Parent := Panel1;
    end;
  end;
end;


procedure llenarEdits(Edits:TMatriz);
var
  i, j:integer;
begin
  for i:=1 to ma do
  begin
    for j:=1 to ma do
    begin
      Edits[i,j].text := IntToStr(Random(100));
    end;
  end;
end;

procedure TfrmEjecucion.Button1Click(Sender: TObject);
var
  matriz:TMatriz;
  i,j : Integer;
begin
  if Trim(Edt.Text) = '' then
  begin
    ShowMessage('Debe escribir un número');
    Exit;
  end;
  //Grivera 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
    ma := StrToInt(Edt.Text);
    SetLength(m, StrToInt(Edt.Text),StrToInt(Edt.Text));
    Button1.Visible := False;
    Edt.Visible := False;
  end;
  CrearEdits(matriz);
  llenarEdits(matriz);
end;

end.

pero me genera dos errores que son al momento de crear los edit

Código Delphi [-]

Edits[i,j]:=TEdit.Create(Self);  // [dcc32 Error] Ejecucion.pas(46): E2003 Undeclared identifier: 'Self'
Edits[i,j].Parent := Panel1;  //[dcc32 Error] Ejecucion.pas(54): E2003 Undeclared identifier: 'Panel1'

lo tengo asi pero me genera error en esas dos lineas de codigo
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 06:53:14.


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