Sign in to follow this  
Followers 0
Aceguy

Listview scrolling bar problem. [SOLVED]

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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

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  
Followers 0