Missing image in ListView

J

James

I created a .Net add-in for Microsoft Excel.When the application load, all
the images that will be used in the application will be loaded. I have a few
forms, and some of them contain ListView control. I used the LargeIcon view
with 72x40 pixel icons. The listview has about 20 items.

My problem is: Sometime the image is not displayed. The space for the image
is there, but the image is not displayed. The more interesting thing is:
this does not happen every time. It only happens about 50% of the time. I
walkthrough my code and there were nothing wrong. The images did loaded
properly, but some how not displayed.

I suspected the problem was originate from the GC. I tried to run a full GC
before the form that has ListView control in it but it doesn't help. Other
things like putting the images as BMP instead of inside the DLL also doesn't
work. Loading the images when the form loads also doesn't work.

Anybody has any idea?

Thank you.

James
 
A

Atul

Are you using XP themes using Application.EnableVisualStyles? If so, try
using Application.DoEvents imm afterwards.

----------------
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For .Net & ActiveX
Windows Explorer GUI Controls
&
Quick-Launch Like Appbars, MSN/Office2003 Style Popups,
System Tray Icons and Shortcuts/Internet Shortcuts
 
J

James

No I am not using Application.EnableVisualStyles(). In fact, if I use
Application.EnableVisualStyles, Excel crashes when I close a form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top