Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid Olebound Control Display Problem

Status
Not open for further replies.

johnbuckley

Technical User
Mar 25, 2002
52
0
0
GB
I want to create a grid which looks exactly like the files display in Windows Explorer. So I have a table with 2 fields, one being a general field with the icon in it and one with the file name. My grid has a oleboundcontrol in the first column and the file names in the second. No grid lines.

And it looks fine until you put focus onto the grid. Then every icon gets a border around it,like a row of boxes in each row of the column. This disappears when you click on that record.

Any idea how I can stop this unsightly mess or perhaps another way to achieve the same display.

Thanks

John
 
johnbuckley

Replace the oleboundcontrol with an image control, column width = 17.

Set Sparse = .F. for the column

Create a new form method called .mBitmapName() or similar.

In the method .mBitmapName() put :-

IF USED([MYTABLE])
[tab].grdExplorer.Column1.Image1.Picture = MYTABLE.bitmap
ENDI

where the field .bitmap contains the path\filename.ext of the bitmap you wish to display.

In the column set the CurrentDynamicControl = THISFORM.mBitmapName()

By using the CurrentDynamicControl property you will be rendering only the visible images in the grid as opposed to all the images should you use a controlsource

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
John,

If you want to mimic the right-hand pane in Windows Explorer, there is a much easier way -- use my SimpleList control. This is essentially a wrapper for the Listview control, which is exactly what Microsoft use for Windows Explorer.

If you'd like a copy of SimpleList, download it from:

Let me know if you have any questions.

Mike


Mike Lewis
Edinburgh, Scotland
 
All the answers, quick as a flash.

Thanks very much

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top