Opened 15 years ago

Closed 15 years ago

#608 closed Bug (Fixed)

GUICtrlSetBkColor not working properly on ListView control

Reported by: MsCreatoR <mscreator@…> Owned by: Jpm
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Background Color ListView Cc:


When GUICtrlSet(Bk)Color() function used on ListView control, there is need to redraw the window to see the changes:

Reproducing Example:

#include <GuiConstants.au3>

$hGUI = GUICreate("Test Script", 570, 200)

$ListView = GUICtrlCreateListView("Column", 20, 10, 260, 150)
GUICtrlCreateListViewItem("Item", $ListView)

$ListBox = GUICtrlCreateList("", 290, 10, 260, 150)

$SetColor_Button = GUICtrlCreateButton("Set Bk Color", 20, 170, 70, 20)
$Redraw_CheckBox = GUICtrlCreateCheckbox("Redraw", 120, 170)

GUISetState(@SW_SHOW, $hGUI)

While 1
	Switch GUIGetMsg()
		Case $SetColor_Button
			GUICtrlSetBkColor($ListBox, 0x0000FF)
			GUICtrlSetBkColor($ListView, 0x0000FF)
			GUICtrlSetColor($ListView, 0xFFFFFF)
			If GUICtrlRead($Redraw_CheckBox) = 1 Then _
				DllCall("User32.dll", "int", "RedrawWindow", "hwnd", $hGUI, "ptr", 0, "int", 0, "int", 5)

As the example shows, with other controls (such as ListBox) the function work correctly, but ListView needs to be redrawn.

Reproducable on,,, (beta).


Attachments (0)

Change History (1)

comment:1 Changed 15 years ago by Jpm

  • Milestone set to
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.