实例1:初始化StirngGrid的首行和首列

StringGrid    实例1:初始化StirngGrid的首行和首列

 

// 主要代码部分:

procedure TForm23.SetSGridTitle(Sender: TObject);

var

 ColIndex, RowIndex: integer;

begin

 //画第一行(标题栏)

 for colIndex := 1 to StringGrid1.ColumnCount do

 begin

    StringGrid1.Cells[colIndex, 0] := '列名' + Chr(ord('A') - 1 + colIndex);

 end;

 //画第一列(数字栏)

 StringGrid1.Columns[0].Width := 30;

 StringGrid1.Cells[0, 0] := '序列';

 for RowIndex := 1 to StringGrid1.RowCount - 1 do

 begin

    StringGrid1.Cells[0, RowIndex] := IntToStr(RowIndex);

 end;

end;

 

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
猜你喜欢
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2021-09-24
相关资源
相似解决方案