Take Away: To determine the total number of columns in a String Grid, refer to its ColCount property and for the total number of rows, refer to RowCount. Determing the currently selected cell is a simple matter of referring to the Col and Row properties.
KB100886
According to the Delphi help, a String Grid (TStringGrid) is "a grid control designed to simplify the handling of strings and associated objects."
The String Grid has a layout that is very similar to a spreadsheet, with columns and rows. To reference a particular cell, you specify its column and row numbers. For example, if you want to work with the contents of the cell located 3 cells over and 2 cells down, use the following code:
StringGrid1.Cells[3,2]
To determine the total number of columns in a String Grid, refer to its ColCount property and for the total number of rows, refer to RowCount.
Determing the currently selected cell is a simple matter of referring to the Col and Row properties.
You can step through each cell's contents by creating two loops. The first thing you need to determine is which direction you want to examine the cells. You can either travel across each row, like records in a table, or you can travel down each column. If you want to examine the cells like a record, the first, or outer, loop would travel the rows and the second, or inner, loop would travel the columns.
By default, the String Grid ignores the ENTER and TAB keys. If you want to include functionality based on those keys it is necessary to trap them with the Key events. A simple example of trapping keys is also included in the sidebar example, it converts all keypresses to uppercase before applying it to the cell.
Create a new application by clicking File|New in Delphi. When the form has been created, drop a String Grid and a Button onto it. Set the String Grid's Options|goEditing property to True. Finally, enter the following code:
procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);
I am looking for solution and ... there's problem to describe that all using my "poor" english
but let me try at last :)
There is a turnamen of chess with x- palyers I can create: table, pairs for each round and so one and so one. My problem is there as I mentoned x - players each of them has own Card of Player After each round winers, losers or draws makers has note in own card to get total result after turnament and to iknow raking up or down ...But how to save after a round result and to know what info belong to a player ?:( sumary it's for 13 round max turnament I wouldn't like to create DataBase file but something like Records of *.dat file Shall I create 13 files for each round? or enough to create one file ?
If tere is any sugestion Please drop me it on my mail address below:
PS: I forgot to add : Info in Card of a player has also names of oponetnts , results of other games and raking of oponents ... Hope I describe all it as should be done :)