Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: ListView Gridline Display Corruption

27 views
Skip to first unread message

Bob Butler

unread,
Oct 5, 2005, 12:25:23 PM10/5/05
to
"Dave" <KingOfT...@community.nospam> wrote in message
news:eEGlvdcy...@tk2msftngp13.phx.gbl
> Anyone ?
>
> I've attached 2 JPG's of a dialog containing a ListView. In both
> there are gridlines artifacts or something being left behind by the
> ListView Control.

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..."

MikeD

unread,
Oct 5, 2005, 5:50:28 PM10/5/05
to

"Dave" <KingOfT...@community.nospam> wrote in message
news:eEGlvdcy...@tk2msftngp13.phx.gbl...

> Anyone ?
>
> I've attached 2 JPG's of a dialog containing a ListView. In both there
> are
> gridlines artifacts or something being left behind by the ListView
> Control.
> I'm curious whether anyone else has ever seen this and whether anyone has
> any suggestions. The one display almost looks like the ListView is trying
> to display the icon portion of the first column. But there is no
> ImageList
> and no Icon property setup on this ListView. I may be able to put
> together
> a sample of this if needed.


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


Jeff Johnson [MVP: VB]

unread,
Oct 6, 2005, 6:00:01 PM10/6/05
to

"MikeD" <nob...@nowhere.edu> wrote in message
news:ubbjLbfy...@TK2MSFTNGP12.phx.gbl...

> 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.


MikeD

unread,
Oct 6, 2005, 6:55:36 PM10/6/05
to

"Jeff Johnson [MVP: VB]" <i....@enough.spam> wrote in message
news:eUuSOFsy...@TK2MSFTNGP15.phx.gbl...


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.

Dave

unread,
Oct 11, 2005, 3:41:21 PM10/11/05
to
As soon as I get a chance to post a sample that exhibits the problem I will.
I can tell you the program runs on 3 entirely different PC's with different
video adapters and produces the same display anomalies so I think I can at
least say that it is my opinion that it's not the video adapter or drivers.


"MikeD" <nob...@nowhere.edu> wrote in message

news:uWgfNksy...@TK2MSFTNGP10.phx.gbl...

Peter Huang [MSFT]

unread,
Oct 11, 2005, 9:58:10 PM10/11/05
to
Hi Dave,

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.

Dave

unread,
Oct 14, 2005, 5:21:11 PM10/14/05
to
I determined what the problem is for anyone interested. Take a look at the
code snippet below. In this sample I am doing a column auto resize of the
last column. What you saw in the Listview JPG I attached is the result of
this. Now there were obviously a set of properties that I had setup for this
listview that control how I do my display. The solution to the problem was
to refresh "lv.Refresh" the listview after I sent the message to tell the
listview to resize. If anyone is interested in the code sample that creates
the problem I will gladly provide it to them. I'm not sure if issueing this
refresh is what is required, but in my cause it was.

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...

Peter Huang [MSFT]

unread,
Oct 18, 2005, 2:16:08 AM10/18/05
to
Hi

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.

0 new messages