Recent

Author Topic: TStringGrid bug?  (Read 4197 times)

ocloma

  • New Member
  • *
  • Posts: 11
TStringGrid bug?
« on: May 24, 2011, 01:20:49 am »
Into example (FPC 2.4.2 and FPC 2.4.4 , lazarus 0.9.30 and 0.9.30.1 last daily snapshot, winxp sp3)

procedure TForm1.Button1Click(Sender: TObject);
var
   columna :TGridColumn;
begin
      StringGrid1.Options:=[goFixedHorzLine,goFixedVertLine,goHorzLine,goRowSelect,goSmoothScroll];
      StringGrid1.Columns.Clear;
      StringGrid1.Clear;
      columna := StringGrid1.Columns.Add;
      columna.Title.Caption:='ONE';
      columna.Width:=0;      {<- IF > 0 NO ERROR}
      columna := StringGrid1.Columns.Add;
      columna.Title.Caption:='TWO';
      columna.Width:=120;
      columna := StringGrid1.Columns.Add;
      columna.Title.Caption:='TREE';
      columna.Width:=200;
      StringGrid1.RowCount:=2;
end;

result in exception (List index out of bounds).

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: TStringGrid bug?
« Reply #1 on: May 24, 2011, 01:34:03 am »
It works here. I placed StringGrid1 on the form at design time.

Lazarus 0.9.31 r30853M FPC 2.5.1 x86_64-linux-qt
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

eny

  • Hero Member
  • *****
  • Posts: 1646
Re: TStringGrid bug?
« Reply #2 on: May 24, 2011, 10:48:52 am »
No probs here.
All posts based on: Win10 (Win64); Lazarus 3_4  (x64) 25-05-2024 (unless specified otherwise...)

 

TinyPortal © 2005-2018