Ver Mensaje Individual
  #1  
Antiguo 07-02-2006
gelitus gelitus is offline
Registrado
 
Registrado: feb 2006
Posts: 3
Reputación: 0
gelitus Va por buen camino
problemas con combobox

Estoy teniendo problemas para agregar items a un combobox, este es el codigo:

Código Delphi [-]
unit Principal;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,Datos;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label1: TLabel;

    procedure Button1Click(Sender: TObject);


  private
    { Private declarations }
  public
  end;
const
  n:integer =40;
var
  Form1: TForm1;
  clases: array[1..5] of string;
  i:integer;

implementation


{$R *.dfm}



procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;


begin
  clases[1]:='Asietos';
  clases[2]:='Caño de Asiento';
  clases[3]:='Collar izq';
  clases[4]:='Cuadro';
  clases[5]:='Orquilla';

  for i:=1 to 5 do
    begin
      Form1.ComboBox1.Items.Add(clases[i]);
    end;





end.

Cuando complilo me salta el siguiente error:

Project Project1.exe raised exception class EAccessViolation with message 'Access Violation at address 00499B54 in module 'Project1.exe'. Read of address 00000304'. Process stopped. Uses Step or runn to continue.

Si alguien tiene idea de que estoy haciendo mal, o tiene otra forma de hacerlo, agradeceria su ayuda.
Responder Con Cita