Solved

TStringGrid:  Selecting cells programmatically

Posted on 1997-06-06
1
2,275 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 20 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now