[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

2523.0. "?How to set a grid cells picture???" by ALICAT::MACKAY (Don Mackay) Mon Mar 24 1997 03:34

I am trying to create a grid control with a column that contains a
picture od a bar - something like a Gantt chart. (its actually a visual
representation of the work done on various support tasks during a day
showing the period of time the task was worked on).

I have creatd a picture box control on the form and I have set the
foreground and background colours. Just for now I also have the picture
box set to be visible.

As I process each row in the grid, I clear the picture box and draw a
rectange in it where I want it using the xxx.LINE method. I then point
to the correct grid cell (yyy.row= and yy.col= statements) and copy the
picture image to the grid (yyy.picture = xxx.image).

The picture box looks how I want it, with the appropriate background
colour and a clearly visible rectange, but only the background appears
to be transferred to the grid.

I have tried to copy the picture .PICTURE property and get nothing
transferred as all. the .IMAGE property seems to only get the
background.

I have looked at the Microsoft knowledge base and found the article
aboutchanging the colour of an individual cell in a grid control
(Q145610).

Any ideas????

Thanks

Don Mackay
T.RTitleUserPersonal
Name
DateLines
2523.1suggestionXSTACY::PATTISONA rolling stone gets the wormMon Mar 24 1997 15:525

Is the AutoRedraw property set to True?


2523.2Works - but why?ALICAT::MACKAYDon MackayTue Mar 25 1997 22:588
>> Is the AutoRedraw property set to True?

No it wasn't (on the Picture control - thats what I assume you were
referring to) but now it is and it works like a charm - THANKS.

As a follow up question - why?


2523.3explanationXSTACY::PATTISONA rolling stone gets the wormWed Mar 26 1997 09:379
Graphics are only "persistent" (eg, will re-appear if hidden/exposed
by another window) when the autoredraw property is set to true. 

If Autoredraw is false, then VB doesnt store the graphic in memory, it
simply draws it on the screen. (You can however put code in the Paint
event, but thats no use in your application)

Dave