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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Listview Picture Causes File Bloat

Status
Not open for further replies.

Derm

Programmer
Apr 10, 2001
9
CA
Hi Everyone,

I've been visiting Tek-Tips for years, but this is my first time posting.

I'm having problems using a listview Activex control on a pretty simple form in VFP 9.0. When I add a picture as background to the listview, the file size of the .SCT suddenly balloons from 65KB to over 1400KB! Even if I remove the picture, the file size stays the same.

I've tried opening the form file as a table, and I've located the bloating in the listview's record in the OLE memo field. I've tried running PACK, PACK MEMO, etc., all with no results. The only other option is to build a new listview, and never add a background picture.

I've looked all over the web for mention of this bug, but I have found nothing. Anyone else ever encounter this form file bloat while using a Listview with a picture?

Derm
 
Hi Derm,

Are you referring to the ActiveX control's Picture property? If so, I am not seeing this same behaviour. I have a Listview with the Picture set to a 13 KB JPG. The form is only 20 KB in size. When I remove the Picture, it goes down to about 12 KB.

The best I can suggest is that you remove the entire control, then add the Listview again, without the picture. After all, the picture is presumably only for cosmetic purposes, and won't add to the functionality.

Hope this helps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks for the response, Mike. Yes, I'm referring to the listview's Picture setting. I've tried various fiddling with the listview settings, but still have shed no new light on the problem.

I was trying to create a 'ledger' style listview using a grey and white striped background. It works surprisingly well IF you have the proportions right, and the font never changes.

Looks like it's back to plain old white background for now.

Derm
 
Derm,

The best I can suggest is that you use the ForeColor property of the individual list item object to set alternating foreground colours. It won't be a ledger style, but it might make the list a bit more readable.

What you really need is a BackColor property for the individual items, but unfortunately that doesn't exist.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Alternating forecolors is a good idea, too. Thanks.

Derm
 
Derm,

Alternatively, you could use the native VFP grid. It's fairly easy to create a ledger-style background.

Or, DBI have a really nice List control. It has a single setting to enable ledger-style backgrounds, plus it has hundreds of other nice features.

But I could understand you wanting to stay with the Listview, especially as it has some features which the native grid and the DBI List both lack.

By the way, you might want to look at my article on the ListView, at (but it won't tell help with setting the background colours).

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Mike,
Thanks for the info. I think I'll stay with the listview for now, since I finally have most of it figured out. I've used grids in the past, and they seem awkward, unfamiliar and ugly to the users and me. Listviews are a "known quantity", warts and all.

I wonder if Microsoft has come out with a new downloadable listview or MSComCtl.ocx. I couldn't find one on their site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top