StringGrid Drag selection

Posted on 2003-03-20
Medium Priority
Last Modified: 2010-04-04

I have a 7 by 1 string grid in place in my application that allows users to indicate which days of the week are applicable by selecting individual cells. When a user selects a cell it toggles its colour to indicate the change.

I would like to expand this to allow users to drag the mouse over the cells they would like to select, so the stringgrid changes all cells that fall under the mouse drag motion.

Any suggestions on how I can achieve this with a TStringGrid would be great.


Question by:mattlaver
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
  • 2
LVL 27

Expert Comment

ID: 8172592
? this does the tstringrid without any additional code

just do a try

meikl ;-)

Author Comment

ID: 8173390
Well no quite, this method only selects the first cell that the mouse was clicked on. It does not select the other cells, even though they are highlighted.

This is true when 'goRangeSelect' is set to True.

I need to capture in my program which cells have been ranged selected so I can paint them a diffrent colour.

I imagine this can be done with one of the events on the TStringList, however am unsure how to do this.
LVL 27

Accepted Solution

kretzschmar earned 500 total points
ID: 8173462
you can lookup the selection-property
in your paint-routine

Expert Comment

ID: 9316667
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

801 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