Solved

bitmap in stringgrid

Posted on 1997-05-16
2
555 Views
Last Modified: 2010-04-03
Does anyone know how to reset the focus of a bitmap in a stringgrid when the user scrolls out of the row&Column and then returns, how do I get he focus back to repaint the bitmap??

eg:
I place a bitmap at Cells[5,5], when the user scrolls say to 5,25 which then places the cell[5,5] outside the view area.

How do I get the bitmap back in focus when the user returns to cell[5,5] or a closeby cell????

regards Darryl
0
Comment
Question by:Darryl050597
[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
2 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1336325
In what way have you put the TBitmap on/in the TStringGrid?
0
 
LVL 1

Accepted Solution

by:
ygolan earned 50 total points
ID: 1336326
You don't need to put the focus on the bitmap in order for it to be painted. Here is the code that makes sure the bitmap will be painted when cell[5,5]is in view :

Use the grid'd OnDrawCell event with the following code :

MyStringGrid.Canvas.Draw(Rect.Left, Rect.Top, MyBitmap);
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

Suggested Solutions

Title # Comments Views Activity
Downloading email attachments 2 96
enhance the following code 3 54
DBCtrlGrid, Delphi, Scroll 8 87
shape, triangle, dbctrlgrid 3 47
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…

739 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