Jump to content

GUICtrlCreateListView and Background Image


 Share

Recommended Posts

So I have a massive script going. one particular part invoving an MDI Child window I want to have an image in the ListView Background.

using the GUICtrlCreateListView Method I am not able to Utilize the _GUICtrlListView_SetBkImage() to set the Background image. 

 

Although if I use the _GUICtrlListView_Create() Method the image sets fine. But they way my script is set up currently would take hours to adjust the script to work properly through _GUICtrlListView_Create(). 

 

Any thoughts on how I can achieve setting the BG of the ListView Without having to change my ListView Creation Method?

 

 

Here is an Example Script of what I am trying to achieve. 

 

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>

Local $Winx = 10
Local $Winy = 100
Local $WinW = 405
Local $WinH = 210

 $hNew_ChildTech = GUICreate("UNPRODUCTIVE TECHNICIANS", $WinW, $WinH, $Winx, $Winy, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_TABSTOP))
 $TechStatusFeed = GUICtrlCreateListView("TECH #|STATUS|First Name|Last Name ", 5, 5, $WinW - 12, $WinH - 10, -1)
_GUICtrlListView_SetColumnWidth($TechStatusFeed, 0, 55)
_GUICtrlListView_SetColumnWidth($TechStatusFeed, 1, 117)
_GUICtrlListView_SetColumnWidth($TechStatusFeed, 2, 100)
_GUICtrlListView_SetColumnWidth($TechStatusFeed, 3, 150)
_GUICtrlListView_SetBkImage($TechStatusFeed, @ScriptDir & "\img\img.jpg")
GUISetState()

While 1
    Sleep(100)
WEnd

 

Link to comment
Share on other sites

Try

$TechStatusFeed = _GUICtrlListView_Create($hNew_ChildTech, "TECH #|STATUS|First Name|Last Name ", 5, 5, $WinW - 12, $WinH - 10, True, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
 _GUICtrlListView_SetExtendedListViewStyle($TechStatusFeed, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE))

instead.

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

_GUICtrlListView_SetBkImage(GUICtrlGetHandle($TechStatusFeed), $PathToImage) sets the image of a listview for me :(

Try

$TechStatusFeed = _GUICtrlListView_Create($hNew_ChildTech, "TECH #|STATUS|First Name|Last Name ", 5, 5, $WinW - 12, $WinH - 10, True, BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS, $LVS_SINGLESEL))
 _GUICtrlListView_SetExtendedListViewStyle($TechStatusFeed, BitOR($LVS_EX_FULLROWSELECT, $WS_EX_CLIENTEDGE))

instead.

 

It seems the image I was trying to use was corrupted in some form as I used a different image and it works with both methods.

Thank you both!

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...