Randomly, listview does not populate with text

B

Bob Dankert

I have a component which inherits from the standard ListView control. Every
once in a while, this listview will not display any text in the control.
This happens randomly, in numerous programs, and without any explainable
reason. When this does happen, I can use debugger to view that the listview
does indeed contain a number of items. Also, I have a slight modification
to the listview to show a tool-tip with the text from the cell currently
below the mouse cursor. When the listview fails to draw the items, I still
get text from the tool-tip, so I know the items are there, they are just not
being drawn. When this happens, I have tried calling the following,
numerous times, in just about every order possible trying to get the
listview to draw and none of them have worked:
listview.refresh()
listview.update()
listview.clear() followed by re-populating
listview.invalidate()
listview.beginupdate() followed by listview.endupdate()

The only way to correct the issue is to close out of the program and re-open
the program, in which case it generally works. I have had a great deal of
difficulty diagnosing this as it only happens maybe once every hundred
times, if even this often. It has happened on numerous computers, so I
can't blame one particular computer as being the problem (though most of the
computers experiencing this problem run Windows XP). I do have some code in
my controls WndProc method, but I do not think any of this should be
affecting this. If needed, I can post this WndProc code (and I can't think
of any other code that would cause it not to paint).

I am looking for suggestions to fix this or if anyone has suggestions how to
debug this problem when it happens, please let me know. If there are any
tools that I can use to see what is causing the problem that do not require
the tool to be started before I run the executable, I would be excited to
know of them (the only tools I know of require the tool to be run before the
program is run.)

Thanks,

Bob Dankert
 
J

Jeffrey Tan[MSFT]

Hi Bob,

Thanks for your time.

Based on my experience, this problem will be most likely caused by an
antivirus software. You can try to turn off all the antivirus softwares on
the problematic machine to check if this problem still existed. Also, if
you are using McAfee, there is a known issue with patches, please refer to:
"Fixing the problem of missing text in controls and messageboxes"
http://dotnet.mvps.org/dotnet/faqs/?id=controlsmissingtextbug&lang=en

If this does not fix your problem, I suggest you create a brand-new little
sample Winform project, add a ListView on the designer and add several
items to it with IDE. When running, is this problem still existed. Then we
can determine if this problem is machine-specific.

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bob Dankert

Thanks for the suggestions, I beleive this was indeed an antivirus issue.

Bob Dankert
 
J

Jeffrey Tan[MSFT]

Ok, if you need further help, please feel free to post. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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