Solved

TStringGrid:  Selecting cells programmatically

Posted on 1997-06-06
1
2,327 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

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…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

617 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