topten

Set background color with _GUICtrlListView_Create

6 posts in this topic

How can I set background color with _GUICtrlListView_Create?

 

 

Great thanx in advance!

Share this post


Link to post
Share on other sites



topten,

Did you even look in the Help file before posting? A cursory glance would have found _GUICtrlListView_SetBkColor. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Ah, shame of me! Thanx, Melba23

Share this post


Link to post
Share on other sites

Some testing, and I get strange situation- I have the background filled in, but when I add the data it "eats the color away"

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

Example()

Func Example()
    Local $idListview

  $Main_GUI =   GUICreate("ListView Set BkColor", 400, 300)
   ; $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
    $hListView2 = _GUICtrlListView_Create( $Main_GUI,  "1| 2 |3 | 4| 5 | 6|7|8|9", 0,  0, 400, 200)
 _GUICtrlListView_SetExtendedListViewStyle($hListView2, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_DOUBLEBUFFER))
 Global $iListBkColor = 0x0000CC
 _GUICtrlListView_SetBkColor($hListView2, 0x8B6F66)
 ;GUICtrlSetBkColor($hListView2, $iListBkColor)
 ;GUICtrlSetBkColor($hListView2, 0xEAFAF3)
    GUISetState(@SW_SHOW)

_GUICtrlListView_AddItem($hListView2, 1,0)
_GUICtrlListView_AddSubItem($hListView2, 0, "1", 1)
_GUICtrlListView_AddSubItem($hListView2, 0, "2", 2)
_GUICtrlListView_AddSubItem($hListView2, 0, "3", 3)
_GUICtrlListView_AddSubItem($hListView2, 0, "4", 4)
_GUICtrlListView_AddSubItem($hListView2, 0, "5", 5)
_GUICtrlListView_AddSubItem($hListView2, 0, "6", 6)
_GUICtrlListView_AddSubItem($hListView2, 0, "7", 7)
_GUICtrlListView_AddSubItem($hListView2, 0, "8", 8)
_GUICtrlListView_AddSubItem($hListView2, 0, "9", 9)

    GUISetState(@SW_SHOW)


    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

What can be the reason for that?

Share this post


Link to post
Share on other sites

topten,

Still too lazy to look in the Help file? Is it really too difficult to look a little further down the list of ListView UDF functions and find a likely candidate such as _GUICtrlListView_SetTextBkColor? ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Shame of me second time.Thanx, Melba23 :ILA2:

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