Jump to content
Sign in to follow this  
lyledg

Listview problems

Recommended Posts

Has anyone seen this issue when scrolling through a listview, and moving an item up and down in the list??

See attached

post-2827-1193278012_thumb.jpg

Share this post


Link to post
Share on other sites

right click on desktop, select properties

Select appearance tab, select Effects

Don't remember but I think you have to turn off the effects.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

I solved this scrolling glitch by invalidating listview's client rectangle upon $LVN_ENDSCROLL notification. Also added $LVS_EX_DOUBLEBUFFER style to eliminate redraw flicker (eventhough it was no big deal, just one flick).

Example using beta...

#include <GuiListView.au3>

Opt("GUICloseOnESC", 0)
Opt("GUIOnEventMode", 1)
Opt("WinWaitDelay", 0)

$sTitle = "Listview gridlines scroll"
$hGui = GUICreate($sTitle, 400, 300, -1, -1, -1, -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "SysEvents")

$listview = GUICtrlCreateListView("asdf|", 0, 0, 400, 250, -1, $LVS_EX_FULLROWSELECT+$LVS_EX_GRIDLINES+$LVS_EX_DOUBLEBUFFER)
GUICtrlSendMsg(-1, 0x101E, 0, 350)
GUICtrlSendMsg(-1, 0x101E, 1, 50)
For $i = 1 To 40
    $s = ""
    For $j = 1 to 40
        $s &= Chr(Random(97, 122, 1))
    Next
    GUICtrlCreateListViewItem($s, $listview)
Next

GUIRegisterMsg($WM_NOTIFY, "On_WM_NOTIFY")
GUISetState()

While 1
    Sleep(1000)
WEnd

Func SysEvents()
    Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
EndFunc
Func On_WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
    ;wparam = cid, lparam = pnmh
    If $wParam = $listview Then
        Local $tNMHDR = DllStructCreate("hwnd hWnd;uint cID;int code", $lParam)
        Local $code = DllStructGetData($tNMHDR, "code")
        Local $hLV = HWnd(DllStructGetData($tNMHDR, "hWnd"))
        Switch $code
            Case $NM_CUSTOMDRAW
            Case $LVN_ENDSCROLL
                _WinAPI_InvalidateRect($hLV)
        EndSwitch
        ;
    EndIf
    Return $GUI_RUNDEFMSG
EndFunc

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...