grid.Cells[grid.col,grid.row]:=’yes’;
end;
end.
StringGrid組件Cells內容分行顯示在Tstringgrid.ondrawcell事件中
DrawText(StringGrid1.Canvas.Handle,pchar(StringGrid1.Cells[Acol,Arow]),Length(StringGrid1.Cells[Acol,Arow]),Rect,DT_WORDBREAK or DT_LEFT);
可以實現文字換行!
在StringGrid怎樣制作只讀的列在 OnSelectCell事件處理程序中,加入: (所有的列均設成可修改的)
if Col mod 2 = 0 then
grd.Options := grd.Options + [goEditing]
else
grd.Options := grd.Options - [goEditing];
stringgrid從文本讀入的問題(Save/Load a TStringGrid to/from a file?)stringgrid從文本讀入的問題
// Save a TStringGrid to a file
procedure SaveStringGrid(StringGrid: TStringGrid; const FileName: TFileName);
var
延伸閱讀
文章來源于領測軟件測試網 http://www.kjueaiud.com/