Solved

TStringGrid's Selection Property (D2)

Posted on 1997-09-17
1
777 Views
Last Modified: 2008-02-26
I want to manually set the Selection property of a TStringGrid. Selection is of type TGridRect.
I have tried the following:

StringGrid1.Selection := Rect(1,1,5,5);

but get the error: "TGridRect and TRect not identical types"

so, is it possible to set a selection manually?
should be an easy one.
0
Comment
Question by:boabyte
1 Comment
 
LVL 3

Accepted Solution

by:
mirek071497 earned 50 total points
ID: 1345384
Yes but function Rect return TRect not TGridRect.
TRect have integer values but TGridRect have longint values.

try this :

var MyRect : TGridRect;

begin
  MyRect.Left :=1;
  MyRect.Top:=1;
  MyRect.Right:= 5;
  MyRect.Bottom := 5;
  StringGrid1.Selection := MyRect;
end;
 
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

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…
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 video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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