what version of VB? what OS? What version of the common controls?
any subclassing or other "unusual" code handling the control or the forms?
Are these always there or do they appear after some sequence of events?
What you show isn't common for the VB5 or VB6 listviews so without more
details it's going to be hard for people to try to duplicate it.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
Does it only happen on one computer or on several? If several, do all of
these have the same video card and driver? Do they all have the same version
of Windows? If only WinXP (and happens on all WinXP systems), are you using
a manifest file? What version of the ListView (or rather Windows Common
Controls) are you using? Are any other programs running (particularly any
program using DirectX video components such as DirectDraw, Direct3D, etc.)?
IOW, you really need to provide more information.
Graphic anomalies like that are frequently due to the video driver. Try
updating the video driver, or even using a different, compatible, video
driver (maybe the generic SVGA driver) and see if the problem goes away.
I'm not saying this is actually the problem, but it's probably something
worth looking into. I doubt very much it's anything to do with the ListView
control or probably anything with your code, though. Being the gambler that
I am, my money would be on the video driver.
--
Mike
Microsoft MVP Visual Basic
> Graphic anomalies like that are frequently due to the video driver. Try
> updating the video driver, or even using a different, compatible, video
> driver (maybe the generic SVGA driver) and see if the problem goes away.
> I'm not saying this is actually the problem, but it's probably something
> worth looking into. I doubt very much it's anything to do with the
> ListView control or probably anything with your code, though. Being the
> gambler that I am, my money would be on the video driver.
I'm not so sure. I've gone through a few computers in my job (with different
video cards every time) and one of my programs has had display issues with
list views regardless of the machine. I'm willing to believe that there
really is some issue between VB and the list view control in certain
circumstances. I've never gone out of my way to try to fix it.
It's quite possible you're right. Still, I think it's not a bad idea to at
least rule out the video driver. As I said, I never claimed this was indeed
the problem. It's just something worth checking into.
Maybe I've been lucky, but I've never had any problems (at least reported to
me) about display problems with a ListView (be it the 5.0 or the 6.0
version) that WEREN'T related to the video driver (IOW, updating the driver,
and in RARE cases going back to an older version of the driver or using an
alternate/compatible driver, fixed the problem). But anything's possible and
I certainly wouldn't rule out that a ListView has display/update problems.
But in troubleshooting such a problem, you need to rule out whatever you
can. That always needs to be the first step.
"MikeD" <nob...@nowhere.edu> wrote in message
news:uWgfNksy...@TK2MSFTNGP10.phx.gbl...
I think you may try to create a new project and build a project with
listview from the scratch to see what cause the problem.
If you can reproduce it with a form with just a listview, can you attatch
the whole reproduce sample in the newsgroup?
If you have concern, you can send to me directly via removing the "online"
from my email address.
Thanks!
Best regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Public Sub lvAutosizeMax(lv As ListView)
Dim col2adjust As Long
col2adjust = lv.ColumnHeaders.Count - 1
Call SendMessage(lv.hWnd, _
LVM_SETCOLUMNWIDTH, _
col2adjust, _
ByVal LVSCW_AUTOSIZE_USEHEADER)
End Sub
' This subroutine resizes the last column to the control width
Public Sub ResizeColumns(lv As ListView)
lvAutosizeMax lv
lv.Refresh
End Sub
"Dave" <KingOfT...@community.nospam> wrote in message
news:Oy4bYupz...@TK2MSFTNGP15.phx.gbl...
From the MSDN,
Refresh Method (ActiveX Controls)
Forces a complete repaint of a form or control.
Commonly we did not recommend to call the API against the control directly
which may break the common normal behavior. For you scenario, maybe the
sendmessage set the column style but did not redraw the entire listview.
So I think the refresh is necessary.
If you still have any concern please feel free to post here together with
the while reproduce sample.