Sign in to follow this  
Followers 0
sanhen

ListView Style problem

4 posts in this topic

#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#Include <GuiImageList.au3>

#NoTrayIcon
Opt("GUIOnEventMode", 1)

_Singleton(@ScriptName)

$hGUI=GUICreate ("test", 500,300,-1,-1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg")


$hListView = GUICtrlCreateListView("", 0, 0,500, 300)
GUICtrlSetStyle($hListView, $LVS_ICON)

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

For $x = 0 To 206
    _GUIImageList_AddIcon($hImage, "shell32.dll","15", True)
    _GUICtrlListView_AddItem($hListView, $x+1, $x)
    
Next

_GUICtrlListView_SetImageList($hListView, $hImage, 0)


GUISetState()


While 1
  
Sleep(250) 

Wend

Func _GuiMsg()
  Switch @GUI_CTRLID 
        Case  $GUI_EVENT_CLOSE
                   Exit  
                                            
        Case $GUI_EVENT_MINIMIZE
                guisetstate(@SW_MINIMIZE)
  
        EndSwitch
        
    EndFunc

I need this:

post-18420-1223228589_thumb.gif

Share this post


Link to post
Share on other sites



sanhen

Where a problem? I don't see. Seem your GUI similar to a GUI in the attached image. :P

Share this post


Link to post
Share on other sites

I need the horizontal scroll bar, and now it is vertical.

Share this post


Link to post
Share on other sites

sanhen

I need the horizontal scroll bar, and now it is vertical.

:( I have not seen this :P Ok, try this:

#include <WindowsConstants.au3>
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#Include <GuiImageList.au3>

#NoTrayIcon
Opt("GUIOnEventMode", 1)

_Singleton(@ScriptName)

$hGUI=GUICreate ("test", 500,300,-1,-1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GuiMsg")

$hListView = GUICtrlCreateListView("", 0, 0,500, 300)
GUICtrlSetStyle($hListView, $LVS_ICON)

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

_GUIImageList_AddIcon($hImage, "shell32.dll", "15", True) ;Extract large icons
_GUICtrlListView_SetImageList($hListView, $hImage, 1)     ;but use as small icons

For $x = 0 To 99
    _GUICtrlListView_AddItem($hListView, $x + 1, 0)
Next

_GUICtrlListView_SetView($hListView, 2) ;Set the view mode (2 = List)

GUISetState()

While 1
  Sleep(100)
Wend

Func _GuiMsg()
  Switch @GUI_CTRLID 
        Case  $GUI_EVENT_CLOSE
            Exit  
        Case $GUI_EVENT_MINIMIZE
            guisetstate(@SW_MINIMIZE)
    EndSwitch
EndFunc

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