hola, quisiera saber si me pueden ayudar en lo siguiente:
estructura:
-empresas
--altas
--bajas
--modificaciones
--consultas
-camiones
--altas
--basja
--etc
tengo en el form principal un treeview y cuando hago click en cada hoja se despliega la pantalla correspondiente; todo fuciona bien hasta que llego a la parte de -camiones--altas.
Aqui me salta el error:
"Project Camiones.exe raised exception class ETreeViewError with message.
List index out of bounds (0)".
Código Delphi
[-]
procedure TMainForm.TreeView1Click(Sender: TObject);
begin
if TreeView1.Items[0].Item[0].Selected then
begin
frmEmpresasAltas := TfrmEmpresasAltas.Create(Self);
try
frmEmpresasAltas.ShowModal;
finally
frmEmpresasAltas.Free;
end;
end
else
if TreeView1.Items[0].Item[1].Selected then
begin
frmEmpresasBajas := TfrmEmpresasBajas.Create(Self);
try
frmEmpresasBajas.ShowModal;
finally
frmEmpresasBajas.Free;
end;
end
else
if TreeView1.Items[0].Item[2].Selected then
begin
frmEmpresasModificaciones := TfrmEmpresasModificaciones.Create(Self);
try
frmEmpresasModificaciones.ShowModal;
finally
frmEmpresasModificaciones.Free;
end;
end
else
if TreeView1.Items[0].Item[3].Selected then
begin
end
else
if TreeView1.Items[1].Item[0].Selected then
begin
frmCamionesAltas := TfrmCamionesAltas.Create(Self);
try
frmCamionesAltas.ShowModal;
finally
frmCamionesAltas.Free;
end;
end;
desde ya gracias.