Listview scroll with XP Visual Styles

B

Bob Dankert

If I have a listview using XP Visual Styles in .Net 1.1
(Application.SetVisualStyles() in the Main method), when the listview has
vertical scrollbars and the user clicks the scroll bar to do a page down or
page up, the grid lines are drawn through the items on the page down, and
are not drawn on page up.
A screen shot of this is at:
http://www.question-mark.net/images/gridlines.jpg
If you need code to replice the issue, let m know (enable XP styles, add a
listview in details mode, populate it with many items, set gridlines to
true, and click above or below the scroll nob on the scroll bar).

Thanks,
Bob Dankert
 
Y

Ying-Shen Yu[MSFT]

Hi Bob,

It seems your problem is related to this issue:

<BUG: Gridlines for ListControl Are Not Drawn Correctly Using the
LVS_EX_GRIDLINES Style>
http://support.microsoft.com/default.aspx?scid=kb;en-us;813791

It has been logged into our bug database and our product group is trying to
fix it in the next release of windows.
Unfortunately, we have no workaround for this problem now.

Please let me know if you have any further questions on this issue.
Thanks for your understanding!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
B

Bob Dankert

Ying,

Thank you very much for pointing this bug out. Do you know if there is any
way to use API and specify that the grid lines for the listcontrol be drawn
via another method? Or, is the only alternative to paint the gridlines
myself and turn off gridlines?? Thanks a lot for the help,

Bob
 
Y

Ying-Shen Yu[MSFT]

Hi Bob,

As far as I know, LVS_EX_GRIDLINES is the only flag to tell list view draw
the grid lines. Besides ownerdraw, since the problem is only occurred on
ListView with Visual Style, maybe you can try using the classic style on
the ListView using P/Invoke the Theme API:
SetWindowTheme(listView1.Handle,string.Empty,string.Empty);
It will only turn off the theme on a certain ListControl.
Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 
B

Bob Dankert

Ying,

I greatly appreciate your support. This will work great for me, being able
to set the theme back to normal for the listview. Do you know if there is
any way to keep the list on the old styles, but keep the columnheaders on
the new styles? I'm not sure if there is some combination of P/Invoke with
API that may be able to do this, but if not -- I will just stick with
everything old style.

Thanks,

Bob
 
Y

Ying-Shen Yu[MSFT]

Hi Bob,

I apologize for the confusion,
After a second try, I had thought this problem was related to the theme,
but after some test, it seems the problem is still happen even if we turned
off the visual style.
so turning off the theme will not workaround this problem.
Currently it seems you have to owner draw the grid lines or use the common
control v5 without visual styles.


Best regards,

Ying-Shen Yu [MSFT]
Microsoft community Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.
 

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