Solved

TStringGrid's Selection Property (D2)

Posted on 1997-09-17
1
780 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
[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
 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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