Modify

Opened 11 years ago

Closed 11 years ago

#3119 closed Bug (No Bug)

GUICtrlSetColor bug

Reported by: lemonxtt Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

remarks Help file of GUICtrlSetColor: "Only Button, Group, ... can currently be colored" but my code:
GUICtrlCreateGroup("Example", 8, 8, 265, 265)
GUICtrlSetColor(-1, $color_blue)

after run, "Example" still black, i think GUICtrlSetColor not work for Group

ps: My Windows is Win 7 and not "Windows XP/Vista style"

Attachments (0)

Change History (2)

comment:1 by mLipok, 11 years ago

What you mean not work ?

#include <GUIConstantsEx.au3>
#include <ColorConstants.au3>
Example()

Func Example()
	GUICreate("My GUI group") ; will create a dialog box that when displayed is centered

	GUICtrlCreateGroup("Group 1", 190, 60, 90, 140)
	GUICtrlSetColor(-1, $color_blue)
	GUICtrlSetBkColor(-1, $COLOR_RED)
	GUICtrlSetBkColor(-1, $COLOR_GREEN)
	GUICtrlCreateRadio("Radio 1", 210, 90, 50, 20)
	GUICtrlCreateRadio("Radio 2", 210, 110, 60, 50)
	GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

	GUISetState(@SW_SHOW) ; will display an empty dialog box

	; Loop until the user exits.
	While 1
		Switch GUIGetMsg()
			Case $GUI_EVENT_CLOSE
				ExitLoop
		EndSwitch
	WEnd
EndFunc   ;==>Example

comment:2 by Melba23, 11 years ago

Resolution: No Bug
Status: newclosed

But to colour the text, rather than the background, you need to remove the style - as the Help file explains:

#include <GUIConstantsEx.au3>
#include <ColorConstants.au3>
Example()

Func Example()
	GUICreate("My GUI group") ; will create a dialog box that when displayed is centered

	$cGroup = GUICtrlCreateGroup("Group 1", 190, 60, 90, 140)
	DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($cGroup), "wstr", 0, "wstr", 0)
	GUICtrlSetColor(-1, $COLOR_RED)
	GUICtrlSetBkColor(-1, $COLOR_GREEN)
	GUICtrlCreateRadio("Radio 1", 210, 90, 50, 20)
	GUICtrlCreateRadio("Radio 2", 210, 110, 60, 50)
	GUICtrlCreateGroup("", -99, -99, 1, 1) ;close group

	GUISetState(@SW_SHOW) ; will display an empty dialog box

	; Loop until the user exits.
	While 1
		Switch GUIGetMsg()
			Case $GUI_EVENT_CLOSE
				ExitLoop
		EndSwitch
	WEnd
EndFunc   ;==>Example

No bug.

M23

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.