Solved

TStringGrid:  Selecting cells programmatically

Posted on 1997-06-06
1
2,314 Views
Last Modified: 2012-06-21
Now that Borland has removed any examples from the Help system I get a little lost on how to do things -- even the most simple.  How do you select a series of cells in a TStringGrid programmatically?
0
Comment
Question by:bedner
[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
1 Comment
 

Accepted Solution

by:
brittain earned 20 total points
ID: 1336846
The Selection property takes a TGridRect parameter for highlighting the correct value you moron.

To access its member you can reference the various properties or maybe right a handy helper routine like:

function TForm1.DoSelect( l, t, r, b : integer ) : TGridRect;
begin
  with Result do begin
    Left := l;
    Top := t;
    Right := r;
    Bottom := b;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  StringGrid1.Selection := DoSelect( 1,2 , x2,y2 );
end;

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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