Jump to content

[Solved] Bitmaps not showing in ListView


Recommended Posts

Hi all!

I'm trying to add some beauty to my listview by including some images. I've been trying to make some tests but for some reason the bitmap doesn't show.

Here's the code I'm using.

#include <WinAPI.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <Constants.au3>
#Include <WinAPI.au3>
_Main()

Func _Main()
    GUICreate("ImageList AddBitmap", 400, 300)
    $listview = GUICtrlCreateListView("Items", 2, 2, 394, 268)
    GUISetState()

    ; Load images
    $hImage = _GUIImageList_Create(32,32)
    _GUIImageList_AddBitmap($hImage, @ScriptDir & "\ok-16.bmp")
    _GUICtrlListView_SetImageList($listview, $hImage, 1)

    ; Add items
    _GUICtrlListView_AddItem($listview, "Item 1")

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main

I attached the bmp file and a screenshot of what I'm seeing.

 

What am I doing wrong? 

Thank you!

 

 

ok-16.bmp

screen.PNG

Edited by Soulstriker
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...