Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

TStringGrid:  Selecting cells programmatically

Posted on 1997-06-06
1
Medium Priority
?
2,349 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
1 Comment
 

Accepted Solution

by:
brittain earned 40 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

886 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