Gridlines display through Text in List View

Started by BPak, March 23, 2008, 12:24:42 AM

Previous topic - Next topic

BPak

Hi
I have made this small test application in Easy Code using GO.

When clicking on Stock Menu and then Clicking the bottom ListView Scroll Button the List View Scrolls but has the Gridlines going through the Text.

I have a Mainfest File in the folder.  If I remove the Manifest File then the Gridlines display correctly.

Project Code and Image of ListView showing Gridlines attached!

Any idea on what I may need to do to correct this, please?

BPak

[attachment deleted by admin]

Ramon Sala

Hi BPak,

Yes, you're right. As the Manifest file just enables the Windows Common controls 6.0,  it seems to be a refresh problem of the new Common controls, so I'm afraid I can do nothing about that. Anyway, I have processed the WM_PAINT of the ListView object (in the ListView procedure) like this:

dlgStocklvStock Frame hWnd, uMsg, wParam, lParam
   Cmp D[uMsg], WM_PAINT
   Jne >
   Invoke InvalidateRect, [hWnd], NULL, FALSE
:  Return (FALSE)
EndF


It is not the best solution as it causes some flickering, but it solves the problem. You can play with updating just the bottom part of the ListView client area.

Ramon

Greetings from Catalonia

BPak

Thanks Ramon.

It works fine. Would need to invalide the whole ListView as the top Button also interferes with the Gridlines display.

Might try some other idea like alternate rows in tinted back color.

Ramon Sala

Hi BPak,

I have found the way to avoid flickering in the ListView object when Common controls 6.0 are enabled. Delete all code in the ListView procedure and just write this:

dlgStocklvStock Frame hWnd, uMsg, wParam, lParam
   Cmp D[uMsg], WM_VSCROLL
   Jne >
   LoWord ([wParam])
   Cmp Ax, SB_THUMBPOSITION
   Jge >
   Invoke GetParent, [hWnd]
   Push Eax
   Invoke SendMessage, Eax, WM_SETREDRAW, FALSE, 0
   Invoke CallDefaultProc, [hWnd], [uMsg], [wParam], [lParam]
   Pop Eax
   Invoke SendMessage, Eax, WM_SETREDRAW, TRUE, 0
   Invoke InvalidateRect, [hWnd], NULL, FALSE
   Invoke SendMessage, [hWnd], WM_PAINT, 0, 0
   Return (TRUE)
:  Return (FALSE)
EndF



No flicker at all!

Ramon
Greetings from Catalonia

BPak

Hi Ramon,

Works like a dream  :clap:

Thanks for the time you spent helping me with this solution.

BTW Great Code Editor !!

BPak