Crash Course Delphi 13 :
StringGrid


Acron with a StringGrid

 
We show Acron's acronyms and meanings in a StringGrid, an Excel-like component for displaying multiple columns.


Showing strings in a StringGrid

A StringGrid is like a super version of a ListBox: it can show multiple columns, and it can show headers in a "fixed" row and/or column. A StringGrid does not have an "items" property, so there is no Delphi procedure for loading strings into a StringGrid. We have to program this ourselves.

A StringGrid has a Cells property for storing its strings, but this is not accessible at design time! We have to fill the Cells at runtime -- let's do a little experiment with this.



The complete code

Modify the OnClick event handler of Button1 as follows:

...

Lesson 2 LESSON 12     TOP