?
Solved

TStringGrid's Selection Property (D2)

Posted on 1997-09-17
1
Medium Priority
?
793 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 200 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month8 days, 2 hours left to enroll

765 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