Jump to content

Listview scrolling bar problem. [SOLVED]


Aceguy
 Share

Recommended Posts

is there a way to make this script scroll Verically.. and not horzontally.

Also is there a well to change the black background to transparent.?? on the Icon.

#include<GuiImageList.au3>
#include<GuiListView.au3>
#include<GuiToolTip.au3>
#include<GUIConstantsEx.au3>
#include<ListViewConstants.au3>
#include<StructureConstants.au3>
#include<WindowsConstants.au3>
Global Const $HDN_FIRST = -300
Global Const $HDN_ITEMCHANGINGA = $HDN_FIRST - 0
Global Const $HDN_BEGINTRACKA = $HDN_FIRST - 6

$Gui = GUICreate("Test", 320, 220)

$hListView = _GUICtrlListView_Create($GUI, "", 10, 10, 300, 200, bitor($LVS_LIST,$LVS_NOLABELWRAP,$LVS_ICON), $WS_EX_CLIENTEDGE)

$hImage = _GUIImageList_Create(32,32)

for $x=0 to 10
_GUIImageList_AddIcon ($hImage, "shell32.dll", $x,1)
_GUICtrlListView_AddItem($hListView, "this is just a test Item",$x)
Next

_GUICtrlListView_SetImageList($hListView, $hImage,1)




GUISetState()

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

While 1
    $msg = GUIGetMsg()
    Switch $msg
    Case $GUI_EVENT_CLOSE
        ExitLoop
    EndSwitch
WEnd
;------------------------------------------------------------------------------

;-----------------------------------------------------------------------------------
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $tNMHDR, $iCode, $tInfo, $iItem
    
    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $iCode
    Case $HDN_ITEMCHANGINGA, $HDN_BEGINTRACKA
        $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
        $iItem = DllStructGetData($tInfo, "Item")
        If $iItem = _GUICtrlListView_GetColumnCount($hListView) - 1 Then Return 1
    EndSwitch
    
    Return $GUI_RUNDEFMSG
EndFunc
Edited by Aceguy
Link to comment
Share on other sites

Aceguy

Try this:

#include<GuiImageList.au3>
#include<GuiListView.au3>
#include<GuiToolTip.au3>
#include<GUIConstantsEx.au3>
#include<ListViewConstants.au3>
#include<StructureConstants.au3>
#include<WindowsConstants.au3>

Global Const $HDN_FIRST = -300
Global Const $HDN_ITEMCHANGINGA = $HDN_FIRST - 0
Global Const $HDN_BEGINTRACKA = $HDN_FIRST - 6

$Gui = GUICreate("Test", 320, 220)

$hListView = _GUICtrlListView_Create($Gui, "", 10, 10, 300, 200, $LVS_LIST, $WS_EX_CLIENTEDGE)

$hImage = _GUIImageList_Create(32, 32, 5, 3)

For $x = 0 To 10
    _GUIImageList_AddIcon($hImage, "shell32.dll", $x, True)
    _GUICtrlListView_AddItem($hListView, "this is just a test Item", $x)
Next

_GUICtrlListView_SetImageList($hListView, $hImage, 1)

_GUICtrlListView_SetView($hListView, 3)

GUISetState()

GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd
;------------------------------------------------------------------------------

;-----------------------------------------------------------------------------------
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
    Local $tNMHDR, $iCode, $tInfo, $iItem

    $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
    $iCode = DllStructGetData($tNMHDR, "Code")

    Switch $iCode
        Case $HDN_ITEMCHANGINGA, $HDN_BEGINTRACKA
            $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
            $iItem = DllStructGetData($tInfo, "Item")
            If $iItem = _GUICtrlListView_GetColumnCount($hListView) - 1 Then Return 1
    EndSwitch

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_NOTIFY

:P

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...