Solved

Use of  TStringGrid

Posted on 2000-02-24
3
249 Views
Last Modified: 2012-05-04
An easy one...

How do I use the TStringGrid component?

Thanks in advance...
   Boomer Dragon
0
Comment
Question by:boomerdragon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 7

Expert Comment

by:daniel_c
ID: 2555465
What do you mean by that question?
What do you want to do with TStringGrid?
0
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 2555536
hi,
drop stringtid onto form and in object insector set the goediting option to true;
run the project and type some stuff in grid..
thats it.
do whatecvver wit the text..
can save and load the grid to file like this:
procedure TForm1.Button1Click(Sender: TObject);
var
 f:textfile;
 x,y:integer;
begin
assignfile (f,'C:\STRING.TXT');
rewrite (f);
writeln (f,stringgrid1.colcount);
writeln (f,stringgrid1.rowcount);
For X:=0 to stringgrid1.colcount-1 do
For y:=0 to stringgrid1.rowcount-1 do
writeln (F, stringgrid1.cells[x,y]);
closefile (f);
END;
procedure TForm1.Button2Click(Sender: TObject);
var f:textfile;
temp,x,y:integer;
tempstr:string;
begin
assignfile (f,'c:\string.txt');
reset (f);
readln (f,temp);
stringgrid1.colcount:=temp;
readln (f,temp);
stringgrid1.rowcount:=temp;
For X:=0 to stringgrid1.colcount-1 do
 For y:=0 to stringgrid1.rowcount-1 do begin
         readln (F, tempstr);
 stringgrid1.cells[x,y]:=tempstr;
 end;
closefile (f);

end;


hope that help
Regards Barry
0
 

Author Comment

by:boomerdragon
ID: 2558515
Thank you very much. I'm trying to move from the VB world, and this StringGrid was a puzzle :-). I was looking for something like a "Format String". Now I know that makes no difference.

Thanks again!

Boomer Dragon
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question