Solved

TStringGrid's Selection Property (D2)

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 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